From 343b80e71816ad389ebea79895ba2f0882039e3c Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Fri, 23 Jan 2009 13:41:03 +0100 Subject: [PATCH] Fix bug #177 by not attempting to define composite debug info for forward-declared structs. --- gen/todebug.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gen/todebug.cpp b/gen/todebug.cpp index f244a487..402088db 100644 --- a/gen/todebug.cpp +++ b/gen/todebug.cpp @@ -439,6 +439,11 @@ static LLGlobalVariable* dwarfCompositeType(Type* type, llvm::GlobalVariable* co } assert(sd); + // if we don't know the aggregate's size, we don't know enough about it + // to provide debug info. probably a forward-declared struct? + if (sd->sizeok == 0) + return NULL; + IrStruct* ir = sd->ir.irStruct; assert(ir); if (ir->dwarfComposite)