Fixed AS1/2 - switch detection

This commit is contained in:
Jindra Petřík
2021-11-27 18:38:23 +01:00
parent 7b2f893c56
commit 44da53dfab
2 changed files with 7 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file.
- AS1/2 - obfuscated name in forin cannot use eval
- Ternar visit (can cause invalid reg declarations)
- AS1/2 - typeof precedence / parenthesis
- AS1/2 - switch detection
## [14.6.0] - 2021-11-22
### Added

View File

@@ -416,7 +416,7 @@ public class ActionGraph extends Graph {
}
}
if (switchedObject == null) {
switchedObject = new DirectValueActionItem(null, null, -1, Null.INSTANCE, null);
//switchedObject = new DirectValueActionItem(null, null, -1, Null.INSTANCE, null);
}
List<GraphTargetItem> caseValuesMap = new ArrayList<>();
@@ -428,6 +428,11 @@ public class ActionGraph extends Graph {
if (set.leftSide instanceof GetVariableActionItem) {
switchedObject = set.leftSide;
}
if (switchedObject == null) {
stack.push(set);
return ret;
}
List<GraphPart> caseBodyParts = new ArrayList<>();
caseBodyParts.add(part.nextParts.get(0));
GraphTargetItem top = null;