From 1923d37f7f1ebc3d701621fa8bfed5cbdf26fba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 22 Jan 2019 18:08:31 +0100 Subject: Do not throw from TraceResolver (#22126) Fixes #22059. --- src/vm/virtualcallstub.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/vm/virtualcallstub.cpp') diff --git a/src/vm/virtualcallstub.cpp b/src/vm/virtualcallstub.cpp index 875ee1cc0d..31cfdd9a6d 100644 --- a/src/vm/virtualcallstub.cpp +++ b/src/vm/virtualcallstub.cpp @@ -2621,13 +2621,13 @@ VirtualCallStubManager::TraceResolver( CONSISTENCY_CHECK(CheckPointer(pMT)); - DispatchSlot slot(pMT->FindDispatchSlot(token, TRUE /* throwOnConflict */)); + DispatchSlot slot(pMT->FindDispatchSlot(token, FALSE /* throwOnConflict */)); if (slot.IsNull() && IsInterfaceToken(token) && pMT->IsComObjectType()) { MethodDesc * pItfMD = GetInterfaceMethodDescFromToken(token); CONSISTENCY_CHECK(pItfMD->GetMethodTable()->GetSlot(pItfMD->GetSlot()) == pItfMD->GetMethodEntryPoint()); - slot = pItfMD->GetMethodTable()->FindDispatchSlot(pItfMD->GetSlot(), TRUE /* throwOnConflict */); + slot = pItfMD->GetMethodTable()->FindDispatchSlot(pItfMD->GetSlot(), FALSE /* throwOnConflict */); } // 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( // all native code versions, even if they aren't the one that was reported by this trace, see // DebuggerController::PatchTrace() under case TRACE_MANAGED. This alleviates the StubManager from having to prevent the // race that occurs here. - return (StubManager::TraceStub(slot.GetTarget(), trace)); + // + // If the dispatch slot is null, we assume it's because of a diamond case in default interface method dispatch. + return slot.IsNull() ? FALSE : (StubManager::TraceStub(slot.GetTarget(), trace)); } #ifndef DACCESS_COMPILE -- cgit v1.2.3