Bug 23979 – ICE on failed alias this attempt on pointer expression

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-06-08T12:28:38Z
Last change time
2023-06-16T09:07:56Z
Keywords
pull
Assigned to
No Owner
Creator
Grim Maple

Comments

Comment #0 by grimmaple95 — 2023-06-08T12:28:38Z
Since 2.104 rolled out, one of my dub packages started segfaulting. See results here: https://github.com/GrimMaple/mud/actions/runs/5203283642/jobs/9402955265
Comment #1 by dkorpel — 2023-06-08T12:55:34Z
The segfaults happens in: ``` ExpressionSemanticVisitor::visit(PtrExp*) (this=0x7fffffff69d8, exp=0x7fffeb62d720) at src/dmd/expressionsem.d:7442 7442 Type tb = exp.e1.type.toBasetype(); (gdb) bt #0 ExpressionSemanticVisitor::visit(PtrExp*) (this=0x7fffffff69d8, exp=0x7fffeb62d720) at src/dmd/expressionsem.d:7442 #1 0x00005555559b66b6 in PtrExp::accept(Visitor*) (this=0x7fffeb62d720, v=0x7fffffff69d8) at src/dmd/expression.d:5481 ``` The PtrExp in question comes from this line: source/mud/memory/smartpointers.d:179 ``` assert(!__traits(compiles, *classPtr)); ``` I'm looking into reducing it
Comment #2 by dkorpel — 2023-06-08T13:23:11Z
Reduced to: ```D class A {} void h() { const auto classPtr = SPtr.init; assert(!__traits(compiles, *classPtr)); } struct SPtr { A ptr() { return A.init; } alias ptr this; } ```
Comment #3 by dlang-bot — 2023-06-08T14:22:36Z
@dkorpel created dlang/dmd pull request #15300 "Fix 23979 - ICE on failed alias this attempt on pointer expression" fixing this issue: - Fix 23979 - ICE on failed alias this attempt on pointer expression https://github.com/dlang/dmd/pull/15300
Comment #4 by dlang-bot — 2023-06-10T17:33:00Z
dlang/dmd pull request #15300 "Fix 23979 - ICE on failed alias this attempt on pointer expression" was merged into stable: - 8e92e709dc1796c163fb979fa0a91783eeb8c902 by Dennis Korpel: Fix 23979 - ICE on failed alias this attempt on pointer expression https://github.com/dlang/dmd/pull/15300
Comment #5 by dlang-bot — 2023-06-16T09:07:50Z
dlang/dmd pull request #15325 "merge stable" was merged into master: - 5e1833a279a8a72f0de0532530cfad832d3ed980 by Dennis: Fix 23979 - ICE on failed alias this attempt on pointer expression (#15300) https://github.com/dlang/dmd/pull/15325
Comment #6 by dlang-bot — 2023-06-16T09:07:56Z
dlang/dmd pull request #15310 "Merge stable" was merged into master: - 5e1833a279a8a72f0de0532530cfad832d3ed980 by Dennis: Fix 23979 - ICE on failed alias this attempt on pointer expression (#15300) https://github.com/dlang/dmd/pull/15310