From 27ee2a10ac589fa8159d95230887b3e0634c856f Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 26 Mar 2024 07:31:12 -0400 Subject: [PATCH] declMethodInstance null check --- IDEHelper/Compiler/BfModule.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 39cc02bc..ece1387c 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -6555,16 +6555,19 @@ BfIRValue BfModule::CreateTypeData(BfType* type, BfCreateTypeDataContext& ctx, b origVTable = typeInstance->mVirtualMethodTable; BfMethodInstance* declMethodInstance = entry.mDeclaringMethod; - if ((mIsComptimeModule) || (typeInstance->IsTypeMemberAccessible(declMethodInstance->mMethodDef->mDeclaringType, mProject))) + if (declMethodInstance != NULL) { - // Prepare to reslot... - entry.mImplementingMethod = entry.mDeclaringMethod; - reslotNames.Add(declMethodInstance->mMethodDef->mName); - } - else - { - // Decl isn't accessible, null out entry - entry.mImplementingMethod = BfMethodRef(); + if ((mIsComptimeModule) || (typeInstance->IsTypeMemberAccessible(declMethodInstance->mMethodDef->mDeclaringType, mProject))) + { + // Prepare to reslot... + entry.mImplementingMethod = entry.mDeclaringMethod; + reslotNames.Add(declMethodInstance->mMethodDef->mName); + } + else + { + // Decl isn't accessible, null out entry + entry.mImplementingMethod = BfMethodRef(); + } } } }