stage4/generate_c/generate_c_st.cc
changeset 667 bd1360f29f15
parent 653 ea78924a1f60
parent 625 c0bda77b37a0
child 668 90b6eb7f1775
--- a/stage4/generate_c/generate_c_st.cc	Thu Oct 04 14:30:51 2012 +0100
+++ b/stage4/generate_c/generate_c_st.cc	Thu Oct 04 15:10:45 2012 +0100
@@ -319,12 +319,23 @@
 // SYM_REF2(structured_variable_c, record_variable, field_selector)
 void *visit(structured_variable_c *symbol) {
   TRACE("structured_variable_c");
+  bool type_is_complex = search_var_instance_decl->type_is_complex(symbol->record_variable);
   switch (wanted_variablegeneration) {
     case complextype_base_vg:
     case complextype_base_assignment_vg:
       symbol->record_variable->accept(*this);
+      if (!type_is_complex) {
+    	s4o.print(".");
+    	symbol->field_selector->accept(*this);
+      }
       break;
     case complextype_suffix_vg:
+      symbol->record_variable->accept(*this);
+      if (type_is_complex) {
+        s4o.print(".");
+        symbol->field_selector->accept(*this);
+      }
+      break;
     case assignment_vg:
       symbol->record_variable->accept(*this);
       s4o.print(".");