[Issue 24460] scope(failure) with a goto breaks safety
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jul 23 14:27:04 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24460
Bolpat <qs.il.paperinik at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |qs.il.paperinik at gmail.com
--- Comment #3 from Bolpat <qs.il.paperinik at gmail.com> ---
It seems `scope(failure) Fix; After;` lowers to
```d
try
{
After;
}
catch(Throwable __o40)
{
Fix;
throw;
}
```
But it should lower to:
```d
try
{
After;
}
catch(Throwable __th)
{
scope(exit) throw __th;
Fix;
}
```
`scope(failure)` is not supposed to be able to swallow the thrown object.
--
More information about the Digitalmars-d-bugs
mailing list