[Issue 24530] New: Rethrowing exception outside of catch clause segfaults with -dip1008
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed May 1 20:23:12 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24530
Issue ID: 24530
Summary: Rethrowing exception outside of catch clause segfaults
with -dip1008
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: chloekek at use.startmail.com
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
object.Exception at example.d(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.
--
More information about the Digitalmars-d-bugs
mailing list