Issue #442 Decompilation regression since nightly ffdec_1.7.4_db2388c37836: fixed

This commit is contained in:
Honfika
2013-12-26 21:50:40 +01:00
parent dfcc7cbc5c
commit f5e205cf85
4 changed files with 13 additions and 9 deletions

View File

@@ -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();

View File

@@ -175,10 +175,12 @@ public class DirectValueActionItem extends ActionItem {
@Override
public boolean isCompileTime(Set<GraphTargetItem> 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);
}

View File

@@ -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();
}
}

View File

@@ -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);