Skip to content

Commit

Permalink
Fix SPMI issue in getHelperFtn (#90888)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Aug 22, 2023
1 parent 3bda6e0 commit 8915575
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2360,15 +2360,6 @@ void MethodContext::recGetHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection
value.A = CastPointer(*ppIndirection);
value.B = CastPointer(result);

if (GetHelperFtn->GetIndex(key) != -1)
{
DLDL oldValue = GetHelperFtn->Get(key);

AssertCodeMsg(oldValue.A == value.A && oldValue.B == oldValue.B, EXCEPTIONCODE_MC,
"collision! old: %016" PRIX64 " %016" PRIX64 ", new: %016" PRIX64 " %016" PRIX64, oldValue.A, oldValue.B, value.A,
value.B);
}

GetHelperFtn->Add(key, value);
DEBUG_REC(dmpGetHelperFtn(key, value));
}
Expand All @@ -2379,19 +2370,7 @@ void MethodContext::dmpGetHelperFtn(DWORD key, DLDL value)
void* MethodContext::repGetHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection)
{
DWORD key = (DWORD)ftnNum;

if ((GetHelperFtn == nullptr) || (GetHelperFtn->GetIndex(key) == -1))
{
#ifdef sparseMC
LogDebug("Sparse - repGetHelperFtn returning nullptr and 0XCAFE0003");
*ppIndirection = nullptr;
return (void*)(size_t)0xCAFE0003;
#else
LogException(EXCEPTIONCODE_MC, "Encountered an empty LWM while looking for %08X", (DWORD)ftnNum);
#endif
}

DLDL value = GetHelperFtn->Get(key);
DLDL value = LookupByKeyOrMiss(GetHelperFtn, key, ": key %u", key);
DEBUG_REP(dmpGetHelperFtn(key, value));

*ppIndirection = (void*)value.A;
Expand Down

0 comments on commit 8915575

Please sign in to comment.