changeset 1045:a91d6fc600cd

Fixed lazy arguments again.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Thu, 05 Mar 2009 18:33:20 +0100
parents 39f12f5aa515
children cc6489f32519
files gen/functions.cpp
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gen/functions.cpp	Wed Mar 04 23:17:32 2009 +0100
+++ b/gen/functions.cpp	Thu Mar 05 18:33:20 2009 +0100
@@ -699,7 +699,12 @@
             if (!refout && (!f->fty->args[i]->byref || lazy))
             {
                 // alloca a stack slot for this first class value arg
-                LLValue* mem = DtoAlloca(DtoType(vd->type), vd->ident->toChars());
+                const LLType* argt;
+                if (lazy)
+                    argt = irloc->value->getType();
+                else
+                    argt = DtoType(vd->type);
+                LLValue* mem = DtoAlloca(argt, vd->ident->toChars());
 
                 // let the abi transform the argument back first
                 DImValue arg_dval(vd->type, irloc->value);