Use typed gep in DtoCastClass (#4082)

This commit is contained in:
Nicholas Wilson 2022-08-31 10:50:20 +08:00 committed by GitHub
parent 68ae4352ab
commit a79a30c41e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -281,7 +281,7 @@ DValue *DtoCastClass(const Loc &loc, DValue *val, Type *_to) {
if (offset != 0) {
assert(offset > 0);
v = DtoBitCast(v, getVoidPtrType());
v = DtoGEP1(v, DtoConstUint(offset));
v = DtoGEP1(LLType::getInt8Ty(gIR->context()), v, DtoConstUint(offset));
}
IF_LOG {
Logger::cout() << "V = " << *v << std::endl;