diff gen/functions.cpp @ 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 45af482e3832
children 6bb04dbee21f
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);