[svn r371] Fixed array init was still broken for immediate slices and complex values.

This commit is contained in:
Tomas Lindquist Olsen 2008-07-14 01:03:53 +02:00
parent f03d8f37c1
commit ee5d84a1fa

View file

@ -113,7 +113,20 @@ void DtoArrayInit(DValue* array, DValue* value)
LLValue* dim = DtoArrayLen(array);
LLValue* ptr = DtoArrayPtr(array);
LLValue* val = value->getRVal();
LLValue* val;
// give slices and complex values storage (and thus an address to pass)
if (value->isSlice() || value->isComplex())
{
val = new llvm::AllocaInst(DtoType(value->getType()), ".tmpparam", gIR->topallocapoint());
DVarValue lval(value->getType(), val, true);
DtoAssign(&lval, value);
}
else
{
val = value->getRVal();
}
assert(val);
// prepare runtime call
LLSmallVector<LLValue*, 4> args;