Commit d621ed9
[ddc] Fix handling of continues in switch statements with labeled continues.
Tested with test case outlined in bug below. This should be tested via Lasse's tests when he lands them.
For slightly more context we compile code like this:
do {
switch (y) {
case 1:
continue L1;
L1:
case 2:
continue;
}
} while (x);
into something like this:
do {
while (true) {
var labelState = y;
switch (labelState) {
case 1:
labelState = 2;
case 2:
continue; // <-- This now only continues the while (true).
}
}
} while (x);
Bug: #59593
Change-Id: I9b343fd918e48cb44b65e90eab39d70fca4758d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397105
Reviewed-by: Nicholas Shahan <[email protected]>
Commit-Queue: Nate Biggs <[email protected]>1 parent 81a7acc commit d621ed9
File tree
2 files changed
+14
-0
lines changed- pkg/dev_compiler/lib/src/kernel
2 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4622 | 4622 | | |
4623 | 4623 | | |
4624 | 4624 | | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
4625 | 4631 | | |
4626 | 4632 | | |
4627 | 4633 | | |
4628 | 4634 | | |
4629 | 4635 | | |
| 4636 | + | |
4630 | 4637 | | |
4631 | 4638 | | |
4632 | 4639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4919 | 4919 | | |
4920 | 4920 | | |
4921 | 4921 | | |
| 4922 | + | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
| 4926 | + | |
| 4927 | + | |
4922 | 4928 | | |
4923 | 4929 | | |
4924 | 4930 | | |
4925 | 4931 | | |
4926 | 4932 | | |
| 4933 | + | |
4927 | 4934 | | |
4928 | 4935 | | |
4929 | 4936 | | |
| |||
0 commit comments