# HG changeset patch # User Tomas Lindquist Olsen # Date 1239907287 -7200 # Node ID 9201e0d41ee5e0d3507315e496da2ebe229d12f3 # Parent 1e699a4e975938faeae9387f8dc6b170b34bfede Fixed forward referenced structs. diff -r 1e699a4e9759 -r 9201e0d41ee5 gen/structs.cpp --- a/gen/structs.cpp Thu Apr 16 20:31:21 2009 +0200 +++ b/gen/structs.cpp Thu Apr 16 20:41:27 2009 +0200 @@ -36,6 +36,10 @@ // make sure type exists DtoType(sd->type); + // if it's a forward declaration, all bets are off. The type should be enough + if (sd->sizeok != 1) + return; + // create the IrStruct IrStruct* irstruct = new IrStruct(sd); sd->ir.irStruct = irstruct; diff -r 1e699a4e9759 -r 9201e0d41ee5 ir/irtypestruct.cpp --- 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.