From 91d0ff88031d572eb7949693bdb854e437baec0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sun, 19 May 2013 13:57:55 +0200 Subject: [PATCH] Issue #95 - better script end handling --- .../com/jpexs/decompiler/flash/graph/Graph.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java index 387266a08..cd77e142e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/flash/graph/Graph.java @@ -491,6 +491,7 @@ public class Graph { } if ((part != null) && (code.size() <= part.start)) { + ret.add(new ScriptEndItem()); return ret; } @@ -532,6 +533,9 @@ public class Graph { try { output.addAll(code.translatePart(p, localData, stack, start, end)); + if ((end >= code.size() - 1) && p.nextParts.isEmpty()) { + output.add(new ScriptEndItem()); + } } catch (Exception ex) { Logger.getLogger(Graph.class.getName()).log(Level.SEVERE, "error during printgraph", ex); return ret; @@ -988,11 +992,11 @@ public class Graph { if ((!ift.onFalse.isEmpty()) && (ift.onFalse.get(ift.onFalse.size() - 1) instanceof ExitItem)) {//((ift.onFalse.size() == 1) && (ift.onFalse.get(0) instanceof ContinueItem) && (((ContinueItem) ift.onFalse.get(0)).loopId == currentLoop.id))) { if (ift.expression != null) { expr = ift.expression; - if (expr instanceof LogicalOpItem) { - expr = ((LogicalOpItem) expr).invert(); - } else { - expr = new NotItem(null, expr); - } + /*if (expr instanceof LogicalOpItem) { + expr = ((LogicalOpItem) expr).invert(); + } else { + expr = new NotItem(null, expr); + }*/ } nextcmds = ift.onFalse; newBody = ift.onTrue;