| Issue 2069: | Labeled break statements mis-handled | |
| 2 people starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
Found in GWT Release: 1.5 Detailed description: The compiler is generating incorrect code when labeled break statements are used. A specific case is included below. Run TestApplication in hosted mode and see the output. Compile it and run it in browser mode and see that the exception gets thrown. It behaves incorrectly in browser mode because the entire first switch statement is getting stripped (see OutputJSSnippet). I've also seen a similar case where the first switch is there but the labeled break is stripped, however I can't isolate that one and it's in proprietary code. There may be simpler cases of this, but this is the best Ive been able to isolate it. Workaround if you have one: None that I know of, other than re-factoring the code Links to the relevant GWT Developer Forum posts: None that I can find |
||||||||||||||||
,
May 31, 2008
Attaching a minimal full Eclipse project that demonstrates the problem with GWT 1.5 RC1. default: break label; is completely lost by the compiler. |
|||||||||||||||||
,
May 31, 2008
The problem also occurs with this pattern:
for (;;) {
switch(cond) {
case 1:
...
continue;
// no default
}
break;
}
|
|||||||||||||||||
,
Jul 01, 2008
(No comment was entered for this change.)
Status: Accepted
Owner: sp...@google.com Cc: sco...@google.com |
|||||||||||||||||
,
Jul 02, 2008
The problem in TestApplication.java as well as LoopBug.java is that the compiler drops breaks that are in the default case of a switch. Normally such a break is useless because the switch is about to end anyway. In the case of a labeled break, though, the break might be for a surrounding loop and thus should not be dropped. The attached patch makes DeadCodeElimination hang on to breaks in default cases when they are labeled.
Status: ReviewPending
|
|||||||||||||||||
,
Jul 07, 2008
LGTM. |
|||||||||||||||||
,
Jul 08, 2008
Committed at revision 3168.
Status: FixedNotReleased
|
|||||||||||||||||
,
Jul 08, 2008
(No comment was entered for this change.)
Labels: Category-Compiler Milestone-1_5_RC2 ReviewBy-scottb
|
|||||||||||||||||
,
Aug 13, 2008
1_5_RC2 has been released.
Status: Fixed
|
|||||||||||||||||
|
|
|||||||||||||||||