-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix stack walking and reporting of default interface methods #21525
Conversation
Default interface methods in their unresolved state don't have a generic context. The generic context is only added once the method is resolved to its implementation.
|
|
This happens when you try to use override in a class where it was not used before. Basically, once you use override for a single virtual method, you need to use it for all. So here, it would be better to stick with just marking the method as virtual and not using the override. |
| DWORD cbSigSize; | ||
| pFunction->GetSig(&pSig, &cbSigSize); | ||
|
|
||
| MetaSig msig(pSig, cbSigSize, pFunction->GetModule(), &typeContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a matching fix for PromoteCallerStackUsingGCRefMap - adjust the GCRef map that gets saved into R2R image at crossgen time?
You should be able to verify it by compiling the affected tests using crossgen before running them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it didn't work. Thanks for spotting! I pushed out a fix.
src/vm/frames.h
Outdated
| // | ||
| // See code:CEEInfo::getMethodSigInternal | ||
| // | ||
| return pMD->GetMethodTable()->IsInterface(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any cases where we actually get into StubDispatchFrame with hidden generic arg?
Maybe this can just return TRUE unconditionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normal virtual method calls on generic types maybe? Or they don't go through here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normal virtual method calls do not have hidden generic arg. The context is in this pointer.
Generic virtual method calls do not go through here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will leave it up to you whether to do this simplification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, simplified it, but I also added an assert to guard that assumption.
|
|
|
@dotnet-bot test Windows_NT x64 Checked CoreFX Tests |
…coreclr#21525) Default interface methods in their unresolved state don't have a generic context. The generic context is only added once the method is resolved to its implementation. Commit migrated from dotnet/coreclr@352a5cb
Default interface methods in their unresolved state don't have a generic context. The generic context is only added once the method is resolved to its implementation.
Fixes #16376. Fixes #16898. Fixes #21044.