From 4b22221eb9552f96902d51c3f26bea5de8c7da23 Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Mon, 5 Dec 2011 12:45:17 +0400 Subject: [PATCH] Fixed #34 - StructType::setBody assert isOpaque() failed --- gen/toir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index d248e332..9c95e075 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -2865,7 +2865,7 @@ LLConstant* StructLiteralExp::toConstElem(IRState* p) // return constant struct if (!constType) constType = LLStructType::get(gIR->context(), types); - else + else if (constType->isOpaque()) constType->setBody(types); return LLConstantStruct::get(constType, llvm::makeArrayRef(constvals)); }