From 4f8426d8f18b87bb8e4bf314053d830009cddcc2 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Thu, 24 Feb 2022 05:35:58 -0800 Subject: [PATCH] Method range check --- IDEHelper/Compiler/BfModuleTypeUtils.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index 11bb4acb..56e35a2c 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -2452,6 +2452,9 @@ void BfModule::ExecuteCEOnCompile(CeEmitContext* ceEmitContext, BfTypeInstance* if (!typeInstance->IsTypeMemberIncluded(methodDef->mDeclaringType, mCurTypeInstance->mTypeDef, this)) continue; + if (methodDef->mIdx >= typeInstance->mMethodInstanceGroups.mSize) + continue; + auto& methodInstanceGroup = typeInstance->mMethodInstanceGroups[methodDef->mIdx]; if (methodInstanceGroup.mDefaultCustomAttributes == NULL) {