# HG changeset patch # User mjsousa # Date 1377193843 -3600 # Node ID 39c755f41ee8e1f81f5ff5b40ccd853563eb8a11 # Parent f9a059c24aeaec70bec6669dbb4e88b8947f93bf Generate correct error message when encountering IL lists embedded in IL formal invocations. diff -r f9a059c24aea -r 39c755f41ee8 absyntax_utils/function_call_param_iterator.cc --- a/absyntax_utils/function_call_param_iterator.cc Thu Aug 22 16:53:17 2013 +0100 +++ b/absyntax_utils/function_call_param_iterator.cc Thu Aug 22 18:50:43 2013 +0100 @@ -464,12 +464,13 @@ void *function_call_param_iterator_c::visit(il_param_assignment_c *symbol) { TRACE("il_param_assignment_c"); - // TODO : We do not yet handle a instruction list passed as parameter !!! - // since we do not yet support it, it is best to simply stop than to fail silently... - if (NULL != symbol->simple_instr_list) ERROR; + symbol_c *expression = NULL; + if (!((NULL != symbol->simple_instr_list) ^ (NULL != symbol->il_operand))) ERROR; + if (NULL != symbol->simple_instr_list) expression = symbol->simple_instr_list; + if (NULL != symbol->il_operand ) expression = symbol->il_operand; current_assign_direction = assign_in; - return handle_parameter_assignment((symbol_c *)symbol->il_assign_operator->accept(*this), symbol->il_operand); + return handle_parameter_assignment((symbol_c *)symbol->il_assign_operator->accept(*this), expression); } /* il_assign_out_operator variable */ diff -r f9a059c24aea -r 39c755f41ee8 stage4/generate_c/generate_c_il.cc --- a/stage4/generate_c/generate_c_il.cc Thu Aug 22 16:53:17 2013 +0100 +++ b/stage4/generate_c/generate_c_il.cc Thu Aug 22 18:50:43 2013 +0100 @@ -840,6 +840,14 @@ break; } + /* We do not yet support embedded IL lists, so we abort the compiler if we find one */ + /* Note that in IL function calls the syntax does not allow embeded IL lists, so this check is not necessary here! */ + /* + {simple_instr_list_c *instruction_list = dynamic_cast(param_value); + if (NULL != instruction_list) STAGE4_ERROR(param_value, param_value, "The compiler does not yet support formal invocations in IL that contain embedded IL lists. Aborting!"); + } + */ + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { /* No value given for parameter, so we must use the default... */ /* First check whether default value specified in function declaration...*/ @@ -1061,6 +1069,11 @@ if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit()) param_value = function_call_param_iterator.next_nf(); + /* We do not yet support embedded IL lists, so we abort the compiler if we find one */ + {simple_instr_list_c *instruction_list = dynamic_cast(param_value); + if (NULL != instruction_list) STAGE4_ERROR(param_value, param_value, "The compiler does not yet support formal invocations in IL that contain embedded IL lists. Aborting!"); + } + symbol_c *param_type = fp_iterator.param_type(); if (param_type == NULL) ERROR; @@ -1229,6 +1242,11 @@ break; } + /* We do not yet support embedded IL lists, so we abort the compiler if we find one */ + {simple_instr_list_c *instruction_list = dynamic_cast(param_value); + if (NULL != instruction_list) STAGE4_ERROR(param_value, param_value, "The compiler does not yet support formal invocations in IL that contain embedded IL lists. Aborting!"); + } + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { /* No value given for parameter, so we must use the default... */ /* First check whether default value specified in function declaration...*/ diff -r f9a059c24aea -r 39c755f41ee8 stage4/generate_c/generate_c_inlinefcall.cc --- a/stage4/generate_c/generate_c_inlinefcall.cc Thu Aug 22 16:53:17 2013 +0100 +++ b/stage4/generate_c/generate_c_inlinefcall.cc Thu Aug 22 18:50:43 2013 +0100 @@ -512,6 +512,14 @@ break; } + /* We do not yet support embedded IL lists, so we abort the compiler if we find one */ + /* Note that in IL function calls the syntax does not allow embeded IL lists, so this check is not necessary here! */ + /* + {simple_instr_list_c *instruction_list = dynamic_cast(param_value); + if (NULL != instruction_list) STAGE4_ERROR(param_value, param_value, "The compiler does not yet support formal invocations in IL that contain embedded IL lists. Aborting!"); + } + */ + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { /* No value given for parameter, so we must use the default... */ /* First check whether default value specified in function declaration...*/ @@ -669,7 +677,12 @@ if ((param_value == NULL) && (fp_iterator.is_extensible_param())) { break; } - + + /* We do not yet support embedded IL lists, so we abort the compiler if we find one */ + {simple_instr_list_c *instruction_list = dynamic_cast(param_value); + if (NULL != instruction_list) STAGE4_ERROR(param_value, param_value, "The compiler does not yet support formal invocations in IL that contain embedded IL lists. Aborting!"); + } + if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) { /* No value given for parameter, so we must use the default... */ /* First check whether default value specified in function declaration...*/