Fixed #1726 Decompiling AS - missing break when on false branch vs continue on true

This commit is contained in:
Jindra Petřík
2021-11-18 09:39:08 +01:00
parent cbbf656853
commit 80c9b7d601
2 changed files with 4 additions and 1 deletions

View File

@@ -1141,12 +1141,13 @@ public class Graph {
}
}
//Switch break onFalse and continue onTrue
if (i < list.size() - 1) {
if ((list.get(list.size() - 1) instanceof ExitItem) || (list.get(list.size() - 1) instanceof BreakItem)) {
if (onFalse.isEmpty() && !onTrue.isEmpty() && (onTrue.get(onTrue.size() - 1) instanceof ContinueItem)) {
ifi.expression = ifi.expression.invert(null);
List<GraphTargetItem> onTrueItems = new ArrayList<>();
for (int j = i + 1; j < list.size(); j++) {
for (int j = i; j < list.size(); j++) {
onTrueItems.add(list.remove(i + 1));
}
list.addAll(i + 1, ifi.onTrue);