diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dd314fa5..8a2e4c488 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ All notable changes to this project will be documented in this file. - AS3 direct editation - NaN can be used as identifier - Pin header for AS2 script in the Resources view should show Class name in the title instead of tag full description +- AS1/2/3 for decompilation with multiple variables ## [23.0.1] - 2025-05-16 ### Fixed diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java index 6277a072e..9a95fe09b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/graph/Graph.java @@ -1463,10 +1463,11 @@ public class Graph { if (list.get(j).getLine() == exprLine && !(list.get(j) instanceof LoopItem /*to avoid recursion and StackOverflow*/)) { forFirstCommands.add(0, list.get(j)); toDelete[j] = true; + break; //do not allow more than 1 } else { break; } - } + } fori.firstCommands.addAll(0, forFirstCommands); } } @@ -1495,8 +1496,8 @@ public class Graph { } } if (!forFirstCommands.isEmpty() || !forFinalCommands.isEmpty()) { - //Do not allow more than 2 first/final commands, since it can be obfuscated - if (forFirstCommands.size() > 2 || forFinalCommands.size() > 2) { + //Do not allow more than 1 first/final command, since it can be obfuscated + if (forFirstCommands.size() > 1 || forFinalCommands.size() > 1) { //put it back for (int k = 0; k < forFirstCommands.size(); k++) { toDelete[i - 1 - k] = false;