--- a/stage4/generate_c/generate_c_il.cc Thu Oct 25 12:39:01 2012 +0100
+++ b/stage4/generate_c/generate_c_il.cc Thu Oct 25 12:48:48 2012 +0100
@@ -1462,7 +1462,18 @@
// SYM_REF1(il_simple_instruction_c, il_simple_instruction, symbol_c *prev_il_instruction;)
-void *visit(il_simple_instruction_c *symbol) {return symbol->il_simple_instruction->accept(*this);}
+void *visit(il_simple_instruction_c *symbol) {
+ /* all previous IL instructions should have the same datatype (checked in stage3), so we get the datatype from the first previous IL instruction we find */
+ implicit_variable_current.datatype = (symbol->prev_il_instruction.empty())? NULL : symbol->prev_il_instruction[0]->datatype;
+ implicit_variable_result .datatype = symbol->datatype;
+
+ symbol->il_simple_instruction->accept(*this);
+
+ implicit_variable_result .datatype = NULL;
+ implicit_variable_current.datatype = NULL;
+ return NULL;
+}
+
/* | il_initial_param_list il_param_instruction */
// SYM_LIST(il_param_list_c)