Opaque pointers: fix type comparison based on pointers for array copy. (don't compare pointers, because with opaque pointers they are always the same)

This commit is contained in:
Johan Engelen 2022-11-14 00:20:35 +01:00
parent 96b5cfb371
commit f213aa7f65

View file

@ -238,7 +238,7 @@ void DtoArrayAssign(const Loc &loc, DValue *lhs, DValue *rhs, EXP op,
LLValue *realRhsArrayPtr = (t2->ty == TY::Tarray || t2->ty == TY::Tsarray)
? DtoArrayPtr(rhs)
: nullptr;
if (realRhsArrayPtr && realRhsArrayPtr->getType() == realLhsPtr->getType()) {
if (realRhsArrayPtr && DtoMemType(t2->nextOf()) == DtoMemType(t->nextOf())) {
// T[] = T[] T[] = T[n]
// T[n] = T[n] T[n] = T[]
LLValue *rhsPtr = DtoBitCast(realRhsArrayPtr, getVoidPtrType());