Bug 20096 – error message 'cannot goto into try block' is followed by seg fault
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-08-01T22:21:49Z
Last change time
2019-08-07T10:33:39Z
Keywords
ice-on-invalid-code, pull
Assigned to
No Owner
Creator
Walter Bright
Comments
Comment #0 by bugzilla — 2019-08-01T22:21:49Z
Code:
void test()
{
int x;
try {
L2:
goto L1;
try
{
L1:
++x;
goto L2;
}
finally
{
++x;
}
} finally {}
}
Compiling gives:
test.d(12): Error: cannot goto into try block
object.Error@(0): Access Violation
----------------
0x00541490 in insertFinallyBlockCalls at C:\cbx\mars\.\s2ir.d(1669)
0x0054168E in insertFinallyBlockGotos at C:\cbx\mars\.\s2ir.d(1762)
0x00534ED2 in FuncDeclaration_toObjFile at C:\cbx\mars\.\glue.d(1182)
0x00541F09 in toObjFile at C:\cbx\mars\.\toobj.d(312)
0x004B3449 in FuncDeclaration at C:\cbx\mars\.\func.d(2403)
0x00541E96 in toObjFile at C:\cbx\mars\.\toobj.d(1016)
0x0053282B in genObjFile at C:\cbx\mars\.\glue.d(409)
Comment #1 by dlang-bot — 2019-08-03T06:32:36Z
@WalterBright created dlang/dmd pull request #10266 "fix Issue 20096 - error message 'cannot goto into try block' is follo…" fixing this issue:
- fix Issue 20096 - error message 'cannot goto into try block' is followed by seg fault
https://github.com/dlang/dmd/pull/10266
Comment #2 by dlang-bot — 2019-08-07T10:33:39Z
dlang/dmd pull request #10266 "fix Issue 20096 - error message 'cannot goto into try block' is follo…" was merged into stable:
- 4442cc705190b33b60bc3ed4ffe7d553f340b367 by Walter Bright:
fix Issue 20096 - error message 'cannot goto into try block' is followed by seg fault
https://github.com/dlang/dmd/pull/10266