Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SPMI issue in getHelperFtn #90888

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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