From 98974b02c010221a39bfa38de4743031a8aedbb9 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Mon, 2 Feb 2009 00:26:32 +0100 Subject: [PATCH] Fix bug #199 --- gen/toir.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gen/toir.cpp b/gen/toir.cpp index 88e70c8a..7af6e3f9 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -2403,6 +2403,10 @@ DValue* StructLiteralExp::toElem(IRState* p) { DValue* v = exprs[i]->toElem(p); inits[i] = v->getRVal(); + + // make sure we get inner structs/staticarrays right + if (DtoIsPassedByRef(v->getType())) + inits[i] = DtoLoad(inits[i]); } }