Merging with Edouard's version
authorMario de Sousa <msousa@fe.up.pt>
Fri, 27 May 2011 18:01:54 +0100
changeset 303 0cdf1410bcd8
parent 302 d120740a6b58 (diff)
parent 301 15bf9ecb936d (current diff)
child 304 1b6d8e3df1b2
Merging with Edouard's version
--- a/stage4/generate_c/generate_c_st.cc	Wed May 18 16:32:46 2011 +0200
+++ b/stage4/generate_c/generate_c_st.cc	Fri May 27 18:01:54 2011 +0100
@@ -155,6 +155,7 @@
 		symbol_c* value,
 		symbol_c* fb_symbol = NULL,
 		symbol_c* fb_value = NULL) {
+  
   unsigned int vartype = search_varfb_instance_type->get_vartype(symbol);
   if (vartype == search_var_instance_decl_c::external_vt) {
     symbolic_variable_c *variable = dynamic_cast<symbolic_variable_c *>(symbol);
@@ -185,10 +186,17 @@
   }
   else
     wanted_variablegeneration = complextype_base_vg;
+  
   symbol->accept(*this);
   s4o.print(",");
   wanted_variablegeneration = expression_vg;
   print_check_function(type, value, fb_value);
+  /* We need to call search_varfb_instance_type->get_vartype() again, as it may have been called
+   * again since we called it in the beginning of this print_setter() function.
+   * This make sure the call to search_varfb_instance_type->type_is_complex() will return
+   * the correct value regarding our 'symbol'.
+   */
+  search_varfb_instance_type->get_vartype(symbol);
   if (search_varfb_instance_type->type_is_complex()) {
     s4o.print(",");
     wanted_variablegeneration = complextype_suffix_vg;