diff --git a/CHANGELOG.md b/CHANGELOG.md index 620322361..9cab4c77f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java index 7aacb2f98..ad20bca9c 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/ActionGraph.java @@ -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 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 caseBodyParts = new ArrayList<>(); caseBodyParts.add(part.nextParts.get(0)); GraphTargetItem top = null;