diff --git a/CHANGELOG.md b/CHANGELOG.md index e8549cbed..357db6810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ All notable changes to this project will be documented in this file. - AS1/2 - direct editation - gotoAndPlay/Stop with scenebias - AS1/2 - parenthesis around callfunction - AS1/2 - deobfuscate function parameter names in registers +- AS1/2 - direct editation - do..while ## [14.6.0] - 2021-11-22 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java index d185bc05b..729953798 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java @@ -256,7 +256,14 @@ public class ActionSourceGenerator implements SourceGenerator { @Override public List generate(SourceGeneratorLocalData localData, DoWhileItem item) throws CompilationException { List ret = new ArrayList<>(); - List doExpr = generateToActionList(localData, item.expression); + List doExpr = new ArrayList<>(); + + List ex = new ArrayList<>(item.expression); + if (!ex.isEmpty()) { + GraphTargetItem lastItem = ex.remove(ex.size() - 1); + doExpr.addAll(generateToActionList(localData, ex)); + doExpr.addAll(toActionList(lastItem.toSource(localData, this))); //Want result + } List doBody = generateToActionList(localData, item.commands); int doBodyLen = Action.actionsToBytes(doBody, false, SWF.DEFAULT_VERSION).length;