Bug 23166 – seg fault when compiling with -inline

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-06-07T02:17:19Z
Last change time
2022-07-09T16:32:02Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2022-06-07T02:17:19Z
The following: bool __equals(scope const char[] lhs, scope const char[] rhs) { if (lhs.length != rhs.length) return false; { import core.stdc.string : memcmp; return lhs.length == 0; } return true; } int test(string type) { return __equals(type, "as-is"); } generates a seg fault when compiling with -inline. The seg fault is on line 4008 of e2ir.d: switch (e.op) The import statement appears to be the trigger.
Comment #1 by bugzilla — 2022-06-07T02:18:14Z
It's dmd that's seg faulting.
Comment #2 by dlang-bot — 2022-06-07T03:15:23Z
@WalterBright created dlang/dmd pull request #14191 "fix Issue 23166 - seg fault when compiling with -inline" fixing this issue: - fix Issue 23166 - seg fault when compiling with -inline https://github.com/dlang/dmd/pull/14191
Comment #3 by dlang-bot — 2022-06-10T00:22:32Z
dlang/dmd pull request #14191 "fix Issue 23166 - seg fault when compiling with -inline" was merged into stable: - d7e8ccbb5bca974eb813750558f5dcec3d67735f by Walter Bright: fix Issue 23166 - seg fault when compiling with -inline https://github.com/dlang/dmd/pull/14191
Comment #4 by dlang-bot — 2022-07-09T16:32:02Z
dlang/dmd pull request #14280 "merge stable" was merged into master: - 26e08f01d33215e1ae326fda530fb4a7fd9e7d6d by Walter Bright: fix Issue 23166 - seg fault when compiling with -inline https://github.com/dlang/dmd/pull/14280