Bug 11562 – Goto into or out of finally block is not caught during semantic

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-20T02:17:00Z
Last change time
2013-11-20T19:52:09Z
Keywords
accepts-invalid, pull, wrong-code
Assigned to
yebblies
Creator
yebblies
Blocks
602

Comments

Comment #0 by yebblies — 2013-11-20T02:17:35Z
These should all pass: // Goto into finally block (forwards) static assert(!__traits(compiles, (bool b) { if (b) goto label; try { } finally { label: {} } return 1; })); // // Goto into finally block (backwards) static assert(!__traits(compiles, (bool b) { try { } finally { label: {} } if (b) goto label; return 1; })); // Goto out of finally block (forwards) static assert(!__traits(compiles, (bool b) { try { } finally { if (b) goto label; } label: {} return 1; })); // // Goto out of finally block (backwards) static assert(!__traits(compiles, (bool b) { label: {} try { } finally { if (b) goto label; } return 1; }));
Comment #1 by yebblies — 2013-11-20T02:24:46Z
Comment #2 by github-bugzilla — 2013-11-20T15:43:56Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/50897fb9a77a4911f22123bb2e9240e12cdfaf17 Fix Issue 11562 - Goto into or out of finally block is not caught during semantic https://github.com/D-Programming-Language/dmd/commit/ba945fa6d6bc538c25d7751cbfa1c7d417f1a031 Merge pull request #2836 from yebblies/issue11562 Issue 11562 - Goto into or out of finally block is not caught during semantic