D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9068 - ICE when trying to break outer loop from inside switch statement
Summary: ICE when trying to break outer loop from inside switch statement
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P2 major
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2012-11-23 16:09 UTC by hsteoh
Modified: 2013-05-10 12:36 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description hsteoh 2012-11-23 16:09:18 UTC
import std.range;
import std.stdio;

void main() {
        X: foreach (l; stdin.byLine()) {
                switch(l.front) {
                case 'q':
                        break X;
                default:
                }
        }
}

With latest git dmd:

Internal error: s2ir.c 731
Comment 1 github-bugzilla 2012-12-20 09:06:37 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4db6e34c293d9a6c6a2afe750b13cbb8814409e5
Issue 9068 - fix compiler error when breaking from some labelled loops.

Specifically, it affected loops that get implicitly wrapped into additional
clauses, such as try/finally, causing the label to refer to another statement.

https://github.com/D-Programming-Language/dmd/commit/adcdfd7bd0cdea8b0f79cef4a687cd4eb77b3c53
Merge pull request #1394 from dsagal/bug9068

Issue 9068 - fix compiler error when breaking from some labelled loops.
Comment 2 hsteoh 2012-12-20 09:52:33 UTC
Tested on latest git HEAD dmd, Linux/64bit, confirmed fixed by above pull request.
Comment 3 github-bugzilla 2013-05-10 12:36:35 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/2df2571896d647a6c9d32f754fd21bae1a70cd1e
Move issue 9068 test to runnable/foreach5.d