Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 1923d37

Browse files
MichalStrehovskyjkotas
authored andcommitted
Do not throw from TraceResolver (#22126)
Fixes #22059.
1 parent 635a609 commit 1923d37

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/vm/virtualcallstub.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,13 +2621,13 @@ VirtualCallStubManager::TraceResolver(
26212621
CONSISTENCY_CHECK(CheckPointer(pMT));
26222622

26232623

2624-
DispatchSlot slot(pMT->FindDispatchSlot(token, TRUE /* throwOnConflict */));
2624+
DispatchSlot slot(pMT->FindDispatchSlot(token, FALSE /* throwOnConflict */));
26252625

26262626
if (slot.IsNull() && IsInterfaceToken(token) && pMT->IsComObjectType())
26272627
{
26282628
MethodDesc * pItfMD = GetInterfaceMethodDescFromToken(token);
26292629
CONSISTENCY_CHECK(pItfMD->GetMethodTable()->GetSlot(pItfMD->GetSlot()) == pItfMD->GetMethodEntryPoint());
2630-
slot = pItfMD->GetMethodTable()->FindDispatchSlot(pItfMD->GetSlot(), TRUE /* throwOnConflict */);
2630+
slot = pItfMD->GetMethodTable()->FindDispatchSlot(pItfMD->GetSlot(), FALSE /* throwOnConflict */);
26312631
}
26322632

26332633
// The dispatch slot's target may change due to code versioning shortly after it was retrieved above for the trace. This
@@ -2636,7 +2636,9 @@ VirtualCallStubManager::TraceResolver(
26362636
// all native code versions, even if they aren't the one that was reported by this trace, see
26372637
// DebuggerController::PatchTrace() under case TRACE_MANAGED. This alleviates the StubManager from having to prevent the
26382638
// race that occurs here.
2639-
return (StubManager::TraceStub(slot.GetTarget(), trace));
2639+
//
2640+
// If the dispatch slot is null, we assume it's because of a diamond case in default interface method dispatch.
2641+
return slot.IsNull() ? FALSE : (StubManager::TraceStub(slot.GetTarget(), trace));
26402642
}
26412643

26422644
#ifndef DACCESS_COMPILE

0 commit comments

Comments
 (0)