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 18953 - 32-bit: extern(C++) struct destructor not called cor… #8359

Merged
merged 1 commit into from
Jun 18, 2018

Conversation

rainers
Copy link
Member

@rainers rainers commented Jun 15, 2018

…rectly through runtime

mostly fixed by d08e0fb, but 32-bit platforms other than Win32 are affected, too. Also added function attribute inference for generated shim function.

@dlang-bot
Copy link
Contributor

dlang-bot commented Jun 15, 2018

Thanks for your pull request, @rainers!

Bugzilla references

Auto-close Bugzilla Severity Description
18953 normal Win32: extern(C++) struct destructor not called correctly through runtime

Testing this PR locally

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

dub fetch digger
dub run digger -- build "stable + dmd#8359"

@rainers rainers changed the title fix issue 18953 - Win32: extern(C++) struct destructor not called cor… fix issue 18953 - 32-bit: extern(C++) struct destructor not called cor… Jun 15, 2018
@rainers
Copy link
Member Author

rainers commented Jun 15, 2018

Actually other 32-bit platforms are affected, too. Why do we have to deviate from the C++ ABI to begin with?

@TurkeyMan
Copy link
Contributor

If reviewers could expedite this PR, it should be in 2.081 along with all the other extern(C++) work this cycle.

@JinShil JinShil added this to the 2.081.0 milestone Jun 17, 2018
@JinShil
Copy link
Contributor

JinShil commented Jun 17, 2018

@TurkeyMan Knowing that you have reviewed this helps. Please explicitly mark it "Approved" if that's your determination.

@JinShil JinShil added the Vision Vision Plan https://wiki.dlang.org/Vision/2018H1 label Jun 17, 2018
Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

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

I don't know much about the C++ ABI incompatibility on 32-bit platforms, but this change just lifts the restriction for 64-bit Windows and the test and attribute inference LGTM too.

@@ -1081,6 +1083,7 @@ DtorDeclaration buildExternDDtor(AggregateDeclaration ad, Scope* sc)
ad.members.push(func);
func.addMember(sc2, ad);
func.dsymbolSemantic(sc2);
func.functionSemantic(); // to infer attributes
Copy link
Member

Choose a reason for hiding this comment

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

While this inference change makes sense, I'm not sure whether it's a good idea to combine it with a PR that "just adds a test".

Copy link
Member Author

@rainers rainers Jun 17, 2018

Choose a reason for hiding this comment

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

The commit message already said otherwise, I've updated the PR description now, too.

@rainers
Copy link
Member Author

rainers commented Jun 17, 2018

Does it have to be rebased to stable to make it into 2.081?

@wilzbach
Copy link
Member

Does it have to be rebased to stable to make it into 2.081?

Yup.

@rainers rainers changed the base branch from master to stable June 17, 2018 16:21
@rainers
Copy link
Member Author

rainers commented Jun 17, 2018

Rebased to stable.

…through runtime

Win32 already fixed by d08e0fb
other 32-bit platforms have the same issue
@RazvanN7 RazvanN7 merged commit f95b301 into dlang:stable Jun 18, 2018
kinke added a commit to ldc-developers/ldc that referenced this pull request Jun 23, 2018
dlang/dmd#8359 introduces direct call expressions for struct methods
(which cannot be virtual anyway and are so always called directly).

Our previous code relied on the instance being a class. There are
multiple ways to fix this; I went with this one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Vision Vision Plan https://wiki.dlang.org/Vision/2018H1
Projects
None yet
7 participants