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 12044 - Invalid code gen causes segfault #3257

Merged
merged 1 commit into from
Feb 15, 2014

Conversation

WalterBright
Copy link
Member

@WalterBright
Copy link
Member Author

This is a regression fix, so please pull, as it is blocking 2.065.

@yebblies
Copy link
Member

Could you explain what the problem was and why this fixes it? Otherwise I'm going to have to re-discover the same thing you just did and that seems rather pointless.

S12044!E s;
}
();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to move this case into runnable/link12044.d. It would make easier to re-run testsuite for future linker-issue fixing.

Copy link
Contributor

Choose a reason for hiding this comment

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

@WalterBright I don't like to push everything into xtest64.d.

@9rnsr
Copy link
Contributor

9rnsr commented Feb 14, 2014

@yebblies It is name mangling issue on local enum E. It's declared in lambda, so the before and after the semantic3 of the lambda, it will have different mangle name.

@yebblies
Copy link
Member

@9rnsr Thanks, it's very helpful to have an explanation like that when what's going on isn't immediately obvious and it's in an area of the compiler I don't know well.

@9rnsr
Copy link
Contributor

9rnsr commented Feb 14, 2014

This is a part of the not yet solid D mangling scheme. Until now, several issues were found - Voldemort Types, the symbols mixed-in by unnamed template mixin, the declared symbols inside unrolled foreach statement, mangling for template instances, etc.

And 12044 is comes from the inference of function attributes, return type, and context-ness. So I'm considering to update the mangling scheme to compliant with the extended current language features.

@WalterBright
Copy link
Member Author

@9rnsr is right. Attribute inference in FuncDeclaration::semantic3() changes the type of the function, which changes its name mangling (deco). Types constructed before semantic3() is run will have different decos than after.

@WalterBright
Copy link
Member Author

I'd like to move this case into runnable/link12044.d . It would make easier to re-run testsuite for future linker-issue fixing.

  1. it's not a linker issue, although it was the linker that detected the problem.
  2. Although it makes logical sense to have each test case in its own file, having such would make the test suite take an incredibly long time to run. The longer the test suite takes to run, the less useful it is, because one will start avoiding running it.

@9rnsr
Copy link
Contributor

9rnsr commented Feb 15, 2014

OK.

9rnsr added a commit that referenced this pull request Feb 15, 2014
fix Issue 12044 - Invalid code gen causes segfault
@9rnsr 9rnsr merged commit 4529423 into dlang:master Feb 15, 2014
@WalterBright WalterBright deleted the fix12044 branch February 15, 2014 04:00
@yebblies
Copy link
Member

Although it makes logical sense to have each test case in its own file, having such would make the test suite take an incredibly long time to run. The longer the test suite takes to run, the less useful it is, because one will start avoiding running it.

Having one test per file doesn't mean we only compile one at once. Each test file could contain a unittest block and the tester tool could build 100s at once.

9rnsr added a commit to 9rnsr/dmd that referenced this pull request Feb 15, 2014
fix Issue 12044 - Invalid code gen causes segfault
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants