Bug 23533 – Segmentation fault accessing enum.max with -preview=nosharedaccess
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-12-02T03:10:19Z
Last change time
2022-12-15T22:50:06Z
Keywords
pull
Assigned to
No Owner
Creator
andy.pj.hanson
Comments
Comment #0 by andy.pj.hanson — 2022-12-02T03:10:19Z
To reproduce, just access `E.max` at least once, and an enum member other than the first at least once.
The issue doesn't reproduce if the enum has only one member.
```
enum E { a, b }
void main() {
E x = E.b;
E y = E.max;
}
```
`dmd -preview=nosharedaccess a.d` causes a segmentation fault.
`dmd a.d` has no problem.
Tested with dmd v2.101.0.
Comment #1 by dlang-bot — 2022-12-02T11:45:34Z
@RazvanN7 created dlang/dmd pull request #14667 "Fix Issue 23533 - Segmentation fault accessing enum.max with -preview=nosharedaccess" fixing this issue:
- Fix Issue 23533 - Segmentation fault accessing enum.max with -preview=nosharedaccess
https://github.com/dlang/dmd/pull/14667
Comment #2 by dlang-bot — 2022-12-02T12:43:16Z
dlang/dmd pull request #14667 "Fix Issue 23533 - Segmentation fault accessing enum.max with -preview=nosharedaccess" was merged into stable:
- 038391d230dd01dae989eeb355ac474e4fe5046c by RazvanN7:
Fix Issue 23533 - Segmentation fault accessing enum.max with -preview=nosharedaccess
https://github.com/dlang/dmd/pull/14667
Comment #3 by dlang-bot — 2022-12-15T22:50:06Z
dlang/dmd pull request #14701 "merge stable" was merged into master:
- 39339ead74b42cc6817a7d2d70034c285d5601e3 by Razvan Nitu:
Fix Issue 23533 - Segmentation fault accessing enum.max with -preview=nosharedaccess (#14667)
https://github.com/dlang/dmd/pull/14701