From 9d3e245f697678bbae1a7c7bf784b6e0ace9480e Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 18 Dec 2020 10:52:05 -0800 Subject: [PATCH] Fixed function pointers with 'void* this' --- IDEHelper/Compiler/BfExprEvaluator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 21bcd855..c18e06e0 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -5027,7 +5027,7 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, BfMethodInstance* { if (mModule->mIsConstModule) { - funcCallInst = mModule->mBfIRBuilder->ConstEval_GetInterfaceFunc(irArgs[0], methodInstance->mMethodInstanceGroup->mOwner->mTypeId, methodInstance->mVirtualTableIdx, funcPtrType1); + funcCallInst = mModule->mBfIRBuilder->ConstEval_GetInterfaceFunc(irArgs[0], methodInstance->mMethodInstanceGroup->mOwner->mTypeId, methodInstance->mMethodDef->mIdx, funcPtrType1); } else { @@ -6518,7 +6518,7 @@ SplatArgs(lookupVal, irArgs); { auto underlyingType = wantType->GetUnderlyingType(); mModule->PopulateType(underlyingType, BfPopulateType_Data); - if (underlyingType->IsValuelessType()) + if ((underlyingType->IsValuelessType()) && (!underlyingType->IsVoid())) { // We don't actually pass a 'this' pointer for mut methods on valueless structs argIdx++;