mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 16:11:08 +03:00
Fix initialization of bool arrays
This commit is contained in:
parent
9d5560601a
commit
68c0df413e
1 changed files with 2 additions and 2 deletions
|
@ -287,9 +287,9 @@ void DtoArrayAssign(Loc& loc, DValue* lhs, DValue* rhs, int op, bool canSkipPost
|
||||||
// scalar rhs:
|
// scalar rhs:
|
||||||
// T[] = T T[n][] = T
|
// T[] = T T[n][] = T
|
||||||
// T[n] = T T[n][m] = T
|
// T[n] = T T[n][m] = T
|
||||||
LLValue* elemSize = DtoConstSize_t(getTypePaddedSize(voidToI8(DtoType(elemType))));
|
LLValue* elemSize = DtoConstSize_t(getTypePaddedSize(i1ToI8(voidToI8(DtoType(elemType)))));
|
||||||
LLValue* lhsSize = gIR->ir->CreateMul(elemSize, lhsLength);
|
LLValue* lhsSize = gIR->ir->CreateMul(elemSize, lhsLength);
|
||||||
LLType* rhsType = DtoType(t2);
|
LLType* rhsType = i1ToI8(voidToI8(DtoType(t2)));
|
||||||
LLValue* rhsSize = DtoConstSize_t(getTypePaddedSize(rhsType));
|
LLValue* rhsSize = DtoConstSize_t(getTypePaddedSize(rhsType));
|
||||||
LLValue* actualLength = gIR->ir->CreateExactUDiv(lhsSize, rhsSize);
|
LLValue* actualLength = gIR->ir->CreateExactUDiv(lhsSize, rhsSize);
|
||||||
LLValue* actualPtr = DtoBitCast(lhsPtr, rhsType->getPointerTo());
|
LLValue* actualPtr = DtoBitCast(lhsPtr, rhsType->getPointerTo());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue