From acf1ed40b0355c4534338dce5dd44adcc07bab26 Mon Sep 17 00:00:00 2001 From: Kai Nacke Date: Fri, 3 Jan 2014 23:36:17 +0100 Subject: [PATCH] Emit error message for struct with unknown size. This fixes an ICE in test fail91. --- gen/structs.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gen/structs.cpp b/gen/structs.cpp index 55274b26..e31dada9 100644 --- a/gen/structs.cpp +++ b/gen/structs.cpp @@ -10,6 +10,7 @@ #include "aggregate.h" #include "declaration.h" #include "init.h" +#include "module.h" #include "mtype.h" #include "gen/arrays.h" #include "gen/dvalue.h" @@ -42,7 +43,10 @@ void DtoResolveStruct(StructDeclaration* sd) // if it's a forward declaration, all bets are off. The type should be enough if (sd->sizeok != SIZEOKdone) - return; + { + error("struct %s.%s unknown size", sd->getModule()->toChars(), sd->toChars()); + fatal(); + } // create the IrAggr IrAggr* iraggr = new IrAggr(sd);