# HG changeset patch # User lindquist # Date 1196052633 -3600 # Node ID d580b95cce2ba911413c5a1d589de9e0086db58d # Parent 56a21f3e5d3ee2241e766105951c6f7fbfe9733a [svn r122] Fixed temporary delegates can now alloca their own storage. diff -r 56a21f3e5d3e -r d580b95cce2b gen/arrays.cpp --- a/gen/arrays.cpp Mon Nov 26 04:49:23 2007 +0100 +++ b/gen/arrays.cpp Mon Nov 26 05:50:33 2007 +0100 @@ -91,7 +91,7 @@ } else { - Logger::cout() << "array assignment type dont match: " << *dst->getType() << '\n' << *src->getType() << '\n'; + Logger::cout() << "array assignment type dont match: " << *dst->getType() << "\n\n" << *src->getType() << '\n'; const llvm::ArrayType* arrty = isaArray(src->getType()->getContainedType(0)); if (!arrty) { diff -r 56a21f3e5d3e -r d580b95cce2b gen/toir.cpp --- a/gen/toir.cpp Mon Nov 26 04:49:23 2007 +0100 +++ b/gen/toir.cpp Mon Nov 26 05:50:33 2007 +0100 @@ -2079,8 +2079,14 @@ const llvm::Type* int8ptrty = llvm::PointerType::get(llvm::Type::Int8Ty); - assert(p->topexp() && p->topexp()->e2 == this && p->topexp()->v); - llvm::Value* lval = p->topexp()->v->getLVal(); + llvm::Value* lval; + if (p->topexp() && p->topexp()->e2 == this) { + assert(p->topexp()->v); + lval = p->topexp()->v->getLVal(); + } + else { + lval = new llvm::AllocaInst(DtoType(type), "tmpdelegate", p->topallocapoint()); + } llvm::Value* context = DtoGEP(lval,zero,zero,"tmp",p->scopebb()); llvm::Value* castcontext = new llvm::BitCastInst(u->getRVal(),int8ptrty,"tmp",p->scopebb());