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 Issue 20716 - Wrong code/ABI for extern(C++) interface method tha… #11703

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

WalterBright
Copy link
Member

…t returns non-POD

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
20716 major Wrong code/ABI for extern(C++) interface method that returns non-POD

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#11703"

@WalterBright
Copy link
Member Author

This is ready to go.

@UplinkCoder
Copy link
Member

The commit message is too short.
Just reading the changes don't tell me what's going on.

@UplinkCoder
Copy link
Member

@WalterBright This should be part of the commit message:
The problem here is the "adjustor thunk" generated does not take into account the size of the hidden pointer parameter, and winds up adjusting the hidden pointer rather than the this pointer.

@thewilsonator
Copy link
Contributor

Stable.

Copy link
Contributor

@RazvanN7 RazvanN7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase to stable and add a test to cover the uncovered line and we are good to go.

@@ -4719,6 +4719,8 @@ void cod3_thunk(Symbol *sthunk,Symbol *sfunc,uint p,tym_t thisty,
p += I32 ? 8 : tysize(TYfptr); // far function
else
p += tysize(TYnptr);
if (tybasic(sfunc.ty()) == TYhfunc)
p += tysize(TYnptr); // skip over hidden pointer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line appears to not be covered by tests.

@dlang-bot dlang-bot merged commit 1485c37 into dlang:master Nov 9, 2020
@WalterBright WalterBright deleted the fix20716 branch November 9, 2020 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants