diff ir/irtypestruct.cpp @ 1234:9201e0d41ee5

Fixed forward referenced structs.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Thu, 16 Apr 2009 20:41:27 +0200
parents 212ec2d9d176
children 465a77c904d4
line wrap: on
line diff
--- a/ir/irtypestruct.cpp	Thu Apr 16 20:31:21 2009 +0200
+++ b/ir/irtypestruct.cpp	Thu Apr 16 20:41:27 2009 +0200
@@ -67,6 +67,10 @@
     IF_LOG Logger::println("Building struct type %s @ %s", sd->toPrettyChars(), sd->locToChars());
     LOG_SCOPE;
 
+    // if it's a forward declaration, all bets are off, stick with the opaque
+    if (sd->sizeok != 1)
+        return pa.get();
+
     // find the fields that contribute to the default initializer.
     // these will define the default type.