-
-
Notifications
You must be signed in to change notification settings - Fork 605
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 21794 - ICE: Assertion hit in dinterpret.d #13172
Conversation
Thanks for your pull request, @BorisCarvajal! 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#13172" |
The commit message is not particularly good. |
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.
The code itself is fine.
Please change the commit message though :)
src/dmd/dinterpret.d
Outdated
if (tobt.isintegral()) | ||
emplaceExp!(IntegerExp)(pue, e.loc, 0, e.to); | ||
else if (tobt.isreal()) | ||
emplaceExp!(RealExp)(pue, e.loc, 0, e.to); |
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.
it says that a longdouble_soft
is expected.
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.
Fixed
90c3fd3
to
cdfccb1
Compare
Commit message improved a little, it's really brief like every bug fix on the repo. |
Backports ICE fix from upstream. When casting null to integer or real, instead of painting the type on the NullExp, we emplace an IntegerExp/RealExp with the value zero. Same as when casting from NullExp to bool. Reviewed-on: dlang/dmd#13172 PR d/110511 gcc/d/ChangeLog: * dmd/dinterpret.c (Interpreter::visit (CastExp *)): Handle casting null to int or float. gcc/testsuite/ChangeLog: * gdc.test/compilable/test21794.d: New test. (cherry picked from commit 066385c)
Backports ICE fix from upstream. When casting null to integer or real, instead of painting the type on the NullExp, we emplace an IntegerExp/RealExp with the value zero. Same as when casting from NullExp to bool. Reviewed-on: dlang/dmd#13172 PR d/110511 gcc/d/ChangeLog: * dmd/dinterpret.c (Interpreter::visit (CastExp *)): Handle casting null to int or float. gcc/testsuite/ChangeLog: * gdc.test/compilable/test21794.d: New test.
When casting
null
to integer/real instead of painting the type on the NullExp, we emplace anIntegerExp/RealExp
with value zero like when casting fromNullExp
tobool
.