mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
[svn r371] Fixed array init was still broken for immediate slices and complex values.
This commit is contained in:
parent
f03d8f37c1
commit
ee5d84a1fa
1 changed files with 14 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue