Allow supressing exceptions in diamond inheritance cases#20458
Allow supressing exceptions in diamond inheritance cases#20458MichalStrehovsky merged 4 commits intodotnet:masterfrom
Conversation
| OBJECTREF * protectedObj, // this one can actually be NULL, consider using pMT is you don't need the object itself | ||
| PCODE * ppTarget) | ||
| PCODE * ppTarget, | ||
| BOOL throwOnConflict) |
There was a problem hiding this comment.
throwOnConflict [](start = 18, length = 15)
Is this supposed to be throwOnConflict or throwOnFailure? If throwOnFailure, there is also the type equivalence case to deal with.
There was a problem hiding this comment.
Actually, I see that you handled the type equivalence case, which raises the question again on what this parameter actually means
In reply to: 227099736 [](ancestors = 227099736)
There was a problem hiding this comment.
Should be throwOnConflict, like everywhere else. Fixed.
src/vm/methodtable.cpp
Outdated
| // We can resolve to exact method | ||
| pMD = this->GetMethodDescForInterfaceMethod(pInterfaceMT, pInterfaceMD); | ||
| pMD = this->GetMethodDescForInterfaceMethod(pInterfaceMT, pInterfaceMD, FALSE /* throwOnConflict */); | ||
| _ASSERTE(pMD != NULL); |
There was a problem hiding this comment.
Assertion no longer accurate
There was a problem hiding this comment.
fIsExactMethodResolved should be false if pMT is NULL
In reply to: 227113757 [](ancestors = 227113757)
There was a problem hiding this comment.
Ah, yes. We would hit that assert now. Fixed.
|
|
||
| DispatchSlot slot(pMT->FindDispatchSlot(token)); | ||
| DispatchSlot slot(pMT->FindDispatchSlot(token, TRUE /* throwOnConflict */)); | ||
|
|
There was a problem hiding this comment.
throwing here is going to do something odd in the debugger when stepping into a failing interface dispatch. I'm not convinced throwing is wrong, but I'm not sure what it'll do.
There was a problem hiding this comment.
Good catch, added that to the debugger work tracking issue (#15866).
|
Cc @sergiy-k |
This is an attempt to add a flag that allows suppressing exceptions in diamond inheritance case of default interface methods so that we don't have to wrap things in a try/catch.
Fixes #16123