mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-04 17:11:44 +03:00
Fix static array null assignment/default initialization
This commit is contained in:
parent
901f015ce4
commit
19fd4938be
1 changed files with 10 additions and 2 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue