-
-
Notifications
You must be signed in to change notification settings - Fork 610
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 23705 - dmd: src/dmd/backend/cgcod.d:734: Assertion sz >= 0 failed #14876
Conversation
|
Thanks for your pull request and interest in making D better, @RazvanN7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "stable + dmd#14876" |
| @@ -725,12 +725,12 @@ tryagain: | |||
| @trusted | |||
| targ_size_t alignsection(targ_size_t base, uint alignment, int bias) | |||
| { | |||
| assert(cast(int)base <= 0); | |||
| assert(cast(long)base <= 0); | |||
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.
targ_size_t is an alias to ulong, therefore casting to int gets a part of the number.
a16b2d3 to
db15b5a
Compare
|
Isn't release logically deprecated? ICE is an ICE is an ICE. You should never be able to crash the compiler whatever you're doing. |
db15b5a to
99e96e6
Compare
|
Fair enough. Targeting stable now. |
99e96e6 to
b44c2fa
Compare
|
|
||
| void main () | ||
| { | ||
| ubyte [0x7fff_fffe] x; |
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.
This test fails on many platforms - especially i686 and other 32-bit architectures - as there is no space for the frame pointer - does this fail with a smaller number?
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.
I don't think so, but perhaps static if (size_t.sizeof > 4) could be added.
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.
FAOD, GCC enforces that the maximum size for local variables to occupy the stack to be:
ubyte [(1 << (size_t.sizeof * 8 - 1)) - 64 * size_t.sizeof] x;
That is per function, not per variable.
Targeting master as this manifests in non-release builds, although it might have negative effects on release builds also.