diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index fc2ca0a1a..fa7266076 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -119,6 +119,7 @@ import java.awt.image.BufferedImage; import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.EOFException; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -532,8 +533,11 @@ public final class SWF { sos.writeUI32(fileSize); InflaterInputStream iis = new InflaterInputStream(fis); int i; - while ((i = iis.read()) != -1) { - fos.write(i); + try { + while ((i = iis.read()) != -1) { + fos.write(i); + } + } catch (EOFException ex) { } fis.close(); fos.close(); diff --git a/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java b/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java index be31e2c01..ced861356 100644 --- a/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java +++ b/trunk/src/com/jpexs/decompiler/flash/action/model/DirectValueActionItem.java @@ -175,10 +175,12 @@ public class DirectValueActionItem extends ActionItem { @Override public boolean isCompileTime(Set dependencies) { - if (dependencies.contains(computedRegValue)) { - return false; + if (computedRegValue != null) { + if (dependencies.contains(computedRegValue)) { + return false; + } + dependencies.add(computedRegValue); } - dependencies.add(computedRegValue); return (value instanceof Double) || (value instanceof Float) || (value instanceof Boolean) || (value instanceof Long) || (value instanceof Null) || (computedRegValue != null && computedRegValue.isCompileTime(dependencies)) || (value instanceof String) || (value instanceof ConstantIndex); } diff --git a/trunk/src/com/jpexs/decompiler/graph/Graph.java b/trunk/src/com/jpexs/decompiler/graph/Graph.java index 14698f4ab..63ddd12df 100644 --- a/trunk/src/com/jpexs/decompiler/graph/Graph.java +++ b/trunk/src/com/jpexs/decompiler/graph/Graph.java @@ -1787,7 +1787,6 @@ public class Graph { currentRet.add(new IfItem(null, expr, onTrue, onFalse)); } if (next != null) { - /* todo: honfika if (trueStack.size() != trueStackSizeBefore || falseStack.size() != falseStackSizeBefore) { // it's a hack, because duplicates all instructions in the next part, but better than EmptyStackException onTrue = printGraph(visited, localData, trueStack, allParts, part, next, stopPart, loops, null, staticOperation, path, recursionLevel + 1); @@ -1799,8 +1798,7 @@ public class Graph { } } else { printGraph(visited, localData, stack, allParts, part, next, stopPart, loops, currentRet, staticOperation, path, recursionLevel + 1); - }*/ - printGraph(visited, localData, stack, allParts, part, next, stopPart, loops, currentRet, staticOperation, path, recursionLevel + 1); + } //currentRet.addAll(); } } diff --git a/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java b/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java index 3a8aa0f1b..7b0a06b1e 100644 --- a/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java +++ b/trunk/src/com/jpexs/decompiler/graph/model/BinaryOpItem.java @@ -85,7 +85,7 @@ public abstract class BinaryOpItem extends GraphTargetItem implements BinaryOp { return false; } dependencies.add(leftSide); - if (dependencies.contains(rightSide)) { + if (leftSide != rightSide && dependencies.contains(rightSide)) { return false; } dependencies.add(rightSide);