Skip to content
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 calling a ThisCall delegate via Reverse P/Invoke. #38829

Merged

Conversation

jkoritzinsky
Copy link
Member

The m_paramidx value is always -1 for return values, so we ignore it when emitting in case we are using a byref return value that needs a real arg index (which is 0-based).

Fixes #33129

The m_paramidx value is always -1 for return values, so we ignore it when emitting in case we are using a byref return value that needs a real arg index (which is 0-based).

Fixes dotnet#33129
@AaronRobinsonMSFT
Copy link
Member

AaronRobinsonMSFT commented Jul 6, 2020

The m_paramidx value is always -1 for return values, so we ignore it when emitting in case we are using a byref return value that needs a real arg index (which is 0-based).

The usage of m_paramidx here is amazing. At a minimum we should _ASSERTE(m_paramidx == -1).

@jkoritzinsky
Copy link
Member Author

I'll add that in.

@jkoritzinsky jkoritzinsky force-pushed the fix-thiscall-reverse-pinvoke branch from ae0bcb7 to 08d090b Compare July 6, 2020 23:35
@ghost
Copy link

ghost commented Jul 6, 2020

Hello @jkoritzinsky!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@jkoritzinsky jkoritzinsky merged commit efdaec6 into dotnet:master Jul 8, 2020
@jkoritzinsky jkoritzinsky deleted the fix-thiscall-reverse-pinvoke branch July 8, 2020 19:39
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calli with thiscall convention fails at runtime
3 participants