Bug in located variable initialization code fixed
authorlaurent
Wed, 09 Dec 2009 16:45:27 +0100
changeset 230 816846a8d66b
parent 229 ca7bc1324540
child 231 b8527b0abe75
Bug in located variable initialization code fixed
stage4/generate_c/generate_c_vardecl.cc
--- a/stage4/generate_c/generate_c_vardecl.cc	Tue Dec 08 16:26:06 2009 +0100
+++ b/stage4/generate_c/generate_c_vardecl.cc	Wed Dec 09 16:45:27 2009 +0100
@@ -1661,24 +1661,25 @@
       s4o.print(",");
       symbol->location->accept(*this);
       s4o.print(",");
+      print_variable_prefix();
       if (symbol->variable_name != NULL)
         symbol->variable_name->accept(*this);
       else
         symbol->location->accept(*this);
-      s4o.print(",");
-      print_variable_prefix();
       print_retain();
       s4o.print(")\n");
       if (this->current_var_init_symbol != NULL) {
+    	s4o.print(s4o.indent_spaces);
     	s4o.print(INIT_LOCATED_VALUE);
     	s4o.print("(");
+    	print_variable_prefix();
     	if (symbol->variable_name != NULL)
           symbol->variable_name->accept(*this);
         else
           symbol->location->accept(*this);
     	s4o.print(",");
         this->current_var_init_symbol->accept(*this);
-        s4o.print(")\n");
+        s4o.print(")");
       }
       break;