# HG changeset patch # User laurent # Date 1309786029 -7200 # Node ID 0f1d91a37506b53e921cb096ed31122717c8cc3a # Parent e08e14782a4f9e507330d70c3ef182ec37b9453b Fix bug in inline function calls when using function with undetermined type interface with literals as input diff -r e08e14782a4f -r 0f1d91a37506 stage4/generate_c/generate_c_inlinefcall.cc --- a/stage4/generate_c/generate_c_inlinefcall.cc Wed Jun 29 12:28:59 2011 +0200 +++ b/stage4/generate_c/generate_c_inlinefcall.cc Mon Jul 04 15:27:09 2011 +0200 @@ -91,6 +91,12 @@ std::list::iterator pt; fcall_number++; + if (search_expression_type->is_literal_integer_type(function_type_prefix)) { + function_type_prefix = (symbol_c *)&search_constant_type_c::lint_type_name; + } + else if (search_expression_type->is_literal_real_type(function_type_prefix)) { + function_type_prefix = (symbol_c *)&search_constant_type_c::lreal_type_name; + } s4o.print(s4o.indent_spaces); s4o.print("inline "); @@ -107,7 +113,15 @@ PARAM_LIST_ITERATOR() { if (PARAM_DIRECTION == function_param_iterator_c::direction_in) { - PARAM_TYPE->accept(*this); + if (search_expression_type->is_literal_integer_type(PARAM_TYPE)) { + ((symbol_c *)&search_constant_type_c::lint_type_name)->accept(*this); + } + else if (search_expression_type->is_literal_real_type(PARAM_TYPE)) { + ((symbol_c *)&search_constant_type_c::lreal_type_name)->accept(*this); + } + else { + PARAM_TYPE->accept(*this); + } s4o.print(" "); PARAM_NAME->accept(*this); s4o.print(",\n" + s4o.indent_spaces);