From b8e9d554e5fc68b27bcd8eb93fc895f1ffb49024 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Thu, 5 Mar 2009 18:33:20 +0100 Subject: [PATCH] Fixed lazy arguments again. --- gen/functions.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gen/functions.cpp b/gen/functions.cpp index b554d339a8..ce4b248b16 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -699,7 +699,12 @@ void DtoDefineFunction(FuncDeclaration* fd) 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);