From bc58cb83f4cfff36a30f9ab8ce54a5dcc8f8a83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sun, 2 Jun 2013 17:28:14 +0200 Subject: [PATCH] Issue #104, Multiple conditions in loop fix --- trunk/src/com/jpexs/decompiler/flash/graph/Graph.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java index 59511e17d..54c258b94 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java @@ -595,7 +595,7 @@ public class Graph { ret.add(ti); } else { - printGraph(visited, localData, stack, allParts, parent, next, reversed ? sp1 : sp0, loops, forFinalCommands); + printGraph(visited, localData, stack, allParts, parent, next, reversed ? sp1 : sp0, new ArrayList()/*ignore loops*/, forFinalCommands); GraphTargetItem second = stack.pop(); GraphTargetItem first = stack.pop(); @@ -644,7 +644,7 @@ public class Graph { if ((ti = checkLoop(next, stopPart, loops)) != null) { ret.add(ti); } else { - printGraph(visited, localData, stack, allParts, parent, next, reversed ? sp1 : sp0, loops, forFinalCommands); + printGraph(visited, localData, stack, allParts, parent, next, reversed ? sp1 : sp0, new ArrayList()/*ignore loops*/, forFinalCommands); GraphTargetItem second = stack.pop(); GraphTargetItem first = stack.pop(); @@ -970,6 +970,7 @@ public class Graph { } checkContinueAtTheEnd(loopBody, currentLoop); finalCommands = forFinalCommands.get(currentLoop); + checkContinueAtTheEnd(finalCommands, currentLoop); if (!finalCommands.isEmpty()) { ret.add(new ForTreeItem(null, currentLoop, new ArrayList(), expr, finalCommands, loopBody)); } else { @@ -1134,8 +1135,9 @@ public class Graph { } } if ((nearestLoop != null)) {// && (nearestLoop.loopBreak != null)) { - List finalCommands = printGraph(visited, localData, stack, allParts, part, p, nearestLoop.loopContinue, loops, forFinalCommands); + GraphPart oldCont = nearestLoop.loopContinue; nearestLoop.loopContinue = p; + List finalCommands = printGraph(visited, localData, stack, allParts, part, p, oldCont, loops, forFinalCommands); forFinalCommands.put(nearestLoop, finalCommands); ContinueItem cti = new ContinueItem(null, nearestLoop.id); ret.add(cti);