Use typed GEP in functions.cpp (#4072)

This commit is contained in:
Nicholas Wilson 2022-08-28 21:19:15 +08:00 committed by GitHub
parent 194dfc91f0
commit 2dd2f7fc15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1291,7 +1291,7 @@ void DtoDefineFunction(FuncDeclaration *fd, bool linkageAvailableExternally) {
LLType *targetThisType = thismem->getType();
thismem = DtoBitCast(thismem, getVoidPtrType());
auto off = DtoConstInt(-fd->interfaceVirtual->offset);
thismem = DtoGEP1(thismem, off);
thismem = DtoGEP1(llvm::Type::getInt8Ty(gIR->context()), thismem, off);
thismem = DtoBitCast(thismem, targetThisType);
}
thismem = DtoAllocaDump(thismem, 0, "this");