Bug 24530 – Rethrowing exception outside of catch clause segfaults with -dip1008

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-05-01T20:23:12Z
Last change time
2024-12-13T19:35:00Z
Assigned to
No Owner
Creator
zopsicle
Moved to GitHub: dmd#18236 →

Comments

Comment #0 by zopsicle — 2024-05-01T20:23:12Z
Steps to reproduce: ----- $ cat example.d import std.stdio : writeln; void main() { Throwable a; try throw new Exception("A"); catch (Throwable b) a = b; writeln(a); } $ dmd example.d $ ./example [email protected](6): A ---------------- ??:? _Dmain [0x44f8e8] $ dmd -dip1008 example.d $ ./example zsh: segmentation fault (core dumped) ./example ----- s/writeln(a)/throw a;/ likewise segfaults. I suspect that a is dangling.
Comment #1 by robert.schadek — 2024-12-13T19:35:00Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18236 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB