Bug 22144 – ICE(dcast.d): Floating point exception in castTo::CastTo::visit(Expression*) at dmd/dcast.d:1702

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-07-25T22:47:19Z
Last change time
2021-08-03T02:32:14Z
Keywords
ice, ice-on-invalid-code, pull
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2021-07-25T22:47:19Z
struct test { int[0] foo; } void main() { test* t; cast(typeof(t.foo)[])t.foo; }
Comment #1 by ibuclaw — 2021-07-25T22:48:18Z
The problem is the use of modulo by zero.
Comment #2 by ibuclaw — 2021-07-26T07:58:50Z
Simplified as: --- void main() { int[0] zarray; cast(int[0][])zarray; }
Comment #3 by dlang-bot — 2021-07-26T08:18:28Z
@ibuclaw created dlang/dmd pull request #12924 "fix Issue 22144 - ICE(dcast.d): Floating point exception in castTo::CastTo::visit(Expression*) at dmd/dcast.d:1702" fixing this issue: - fix Issue 22144 - ICE(dcast.d): Floating point exception in castTo::CastTo::visit(Expression*) at dmd/dcast.d:1702 https://github.com/dlang/dmd/pull/12924
Comment #4 by dlang-bot — 2021-07-26T10:07:11Z
dlang/dmd pull request #12924 "fix Issue 22144 - ICE(dcast.d): Floating point exception in castTo::CastTo::visit(Expression*) at dmd/dcast.d:1702" was merged into stable: - fa7ce3520004bdaa92e4e3f352e6fb5090f28319 by Iain Buclaw: fix Issue 22144 - ICE(dcast.d): Floating point exception in castTo::CastTo::visit(Expression*) at dmd/dcast.d:1702 https://github.com/dlang/dmd/pull/12924
Comment #5 by dlang-bot — 2021-07-26T14:51:53Z
dlang/dmd pull request #12927 "[dmd-cxx] fix Issue 22144 - ICE(dcast.d): Floating point exception in castTo::CastTo::visit(Expression*) at dmd/dcast.d:1702" was merged into dmd-cxx: - 16f2345bdf6f6acc46abfa23bba72df5f186e1bf by Iain Buclaw: [dmd-cxx] fix Issue 22144 - ICE(dcast.d): Floating point exception in castTo::CastTo::visit(Expression*) at dmd/dcast.d:1702 https://github.com/dlang/dmd/pull/12927
Comment #6 by dlang-bot — 2021-08-03T02:32:14Z
dlang/dmd pull request #12944 "Merge branch 'stable' into merge_master" was merged into master: - d03f144b07f86ac2e65f460b9869b38acc053233 by Iain Buclaw: fix Issue 22144 - ICE(dcast.d): Floating point exception in castTo::CastTo::visit(Expression*) at dmd/dcast.d:1702 (#12924) https://github.com/dlang/dmd/pull/12944