changeset 915:a69941a2c470

Fix bug #199
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Mon, 02 Feb 2009 00:26:32 +0100
parents a65a6996922f
children 5f4a69a53906
files gen/toir.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gen/toir.cpp	Sun Feb 01 23:30:36 2009 +0100
+++ b/gen/toir.cpp	Mon Feb 02 00:26:32 2009 +0100
@@ -2403,6 +2403,10 @@
         {
             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]);
         }
     }