Fix initialization of bool arrays

This commit is contained in:
David Nadlinger 2015-07-26 17:52:23 +02:00
parent 9d5560601a
commit 68c0df413e

View file

@ -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());