diff gen/classes.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 dd135ff697fa
children 15e9762bb620
line wrap: on
line diff
--- a/gen/classes.cpp	Wed May 06 20:29:27 2009 +0200
+++ b/gen/classes.cpp	Thu May 07 02:10:29 2009 +0200
@@ -53,6 +53,18 @@
     IrStruct* irstruct = new IrStruct(cd);
     cd->ir.irStruct = irstruct;
 
+    // make sure all fields really get their ir field
+    ArrayIter<VarDeclaration> it(cd->fields);
+    for (; !it.done(); it.next())
+    {
+        VarDeclaration* vd = it.get();
+        if (vd->ir.irField == NULL) {
+            new IrField(vd);
+        } else {
+            IF_LOG Logger::println("class field already exists!!!");
+        }
+    }
+
     bool needs_def = mustDefineSymbol(cd);
 
     // emit the ClassZ symbol