-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 totalILArgs for explicithis #85347
Conversation
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.
What about:
runtime/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
Lines 117 to 119 in 5191a75
private bool hasThis() { return ((callConv & CorInfoCallConv.CORINFO_CALLCONV_HASTHIS) != 0); } | |
private bool hasExplicitThis() { return ((callConv & CorInfoCallConv.CORINFO_CALLCONV_EXPLICITTHIS) != 0); } | |
private uint totalILArgs() { return (uint)(numArgs + (hasThis() ? 1 : 0)); } |
I suspect there are a few more places that will need changes, would suggest you review the places where totalILArgs
is used and make sure they're ok. It may be hard to surface these during testing as explicit this signatures are restricted to cases we don't optimize (yet).
@markples perhaps you can review this one? |
It looks like hasthis is also a thing to audit, though that would uncover separate bugs and doesn't need to be part of this PR. Unfortunately, there are a lot of them. In general, it seems to be documented that explicit-call is only for signatures, not methods themselves (assuming that this isn't one of those things were the spec isn't followed), so places that check hascall and ignore explicitcall might be fine anyway. |
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.
My hasthis comment doesn't seem like it should block anything here. Thanks!
@MichalPetryka thanks -- and thanks for splitting this off from your other PR. |
Fixes totalILArgs counting
this
twice with explicithis.Split off from #85197.