From 2dd2f7fc15df87e60d2a12ed6880c8deb061e3d2 Mon Sep 17 00:00:00 2001 From: Nicholas Wilson Date: Sun, 28 Aug 2022 21:19:15 +0800 Subject: [PATCH] Use typed GEP in `functions.cpp` (#4072) --- gen/functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/functions.cpp b/gen/functions.cpp index d7e8427e8d..f4afb6a12e 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -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");