Bug 18057 – [ICE] Segmentation fault (stack overflow) in Expression::ctfeInterpret()

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-12-10T22:35:23Z
Last change time
2019-01-23T00:02:50Z
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2017-12-10T22:35:23Z
Minimal test: --- struct RBNode { RBNode *copy = new RBNode; }
Comment #1 by dfj1esp02 — 2017-12-12T10:50:38Z
What should happen? CTFE should detect and guard against stack overflow?
Comment #2 by ibuclaw — 2017-12-12T22:09:18Z
In this instance, it should detect and guard against stack overflow, because the value of the initializer is indeed recursive. Consider the following, that would cause a stack overflow at runtime: --- struct RBNode { RBNode *copy; this(int num) { this.copy = new RBNode(num++); } } ---
Comment #3 by github-bugzilla — 2018-01-14T20:25:30Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/265e42a2bf63a89f27878fada44e9eb7892e319b fix Issue 18057 - [ICE] Segmentation fault (stack overflow) in Expression::ctfeInterpret() https://github.com/dlang/dmd/commit/74285e41e670bf7e2ae7d83bc9b1617e12f93a65 Merge pull request #7701 from ibuclaw/fix18507 fix Issue 18057 - [ICE] Segmentation fault (stack overflow) in Expression::ctfeInterpret() merged-on-behalf-of: Sebastian Wilzbach <[email protected]>
Comment #4 by github-bugzilla — 2019-01-23T00:02:50Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/8d6d1ea638e92f85b2af9fb83c2c019e38a0afe3 testsuite: Add another test for issue 18057 https://github.com/dlang/dmd/commit/de0782f642913cabb72bc91cf4d81209f035c6e2 Merge pull request #9285 from ibuclaw/fail18057b testsuite: Add another test for issue 18057 merged-on-behalf-of: Nicholas Wilson <[email protected]>