Fix static array null assignment/default initialization

This commit is contained in:
David Nadlinger 2015-07-26 19:34:45 +02:00
parent 901f015ce4
commit 19fd4938be

View file

@ -270,8 +270,16 @@ void DtoArrayAssign(Loc& loc, DValue* lhs, DValue* rhs, int op, bool canSkipPost
// fast version
LLValue* elemSize = DtoConstSize_t(getTypePaddedSize(voidToI8(DtoType(elemType))));
LLValue* lhsSize = gIR->ir->CreateMul(elemSize, lhsLength);
LLValue* rhsSize = gIR->ir->CreateMul(elemSize, rhsLength);
copySlice(loc, lhsPtr, lhsSize, rhsPtr, rhsSize);
if (rhs->isNull())
{
DtoMemSetZero(lhsPtr, lhsSize);
}
else
{
LLValue* rhsSize = gIR->ir->CreateMul(elemSize, rhsLength);
copySlice(loc, lhsPtr, lhsSize, rhsPtr, rhsSize);
}
}
else if (isConstructing)
{