diff gen/structs.cpp @ 1309:0c03ba6f7c24

Fixed deal breaker bug for more-at-once compilation when any module contained aggregates. Fixes ticket #272 .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Thu, 07 May 2009 02:10:29 +0200
parents 8fb39f7f1a7c
children c8b9406d84ca
line wrap: on
line diff
--- a/gen/structs.cpp	Wed May 06 20:29:27 2009 +0200
+++ b/gen/structs.cpp	Thu May 07 02:10:29 2009 +0200
@@ -44,6 +44,18 @@
     IrStruct* irstruct = new IrStruct(sd);
     sd->ir.irStruct = irstruct;
 
+    // make sure all fields really get their ir field
+    ArrayIter<VarDeclaration> it(sd->fields);
+    for (; !it.done(); it.next())
+    {
+        VarDeclaration* vd = it.get();
+        if (vd->ir.irField == NULL) {
+            new IrField(vd);
+        } else {
+            IF_LOG Logger::println("struct field already exists!!!");
+        }
+    }
+
     // perform definition
     bool needs_def = mustDefineSymbol(sd);
     if (needs_def)