AS1/2 ActionTry fix

AS1/2 Infinity
This commit is contained in:
Jindra Petk
2013-04-04 21:34:23 +02:00
parent 11da7d8c68
commit c5edeeb3fb
21 changed files with 1039 additions and 958 deletions

View File

@@ -16,7 +16,7 @@
*/
package com.jpexs.decompiler.flash.graph;
import com.jpexs.decompiler.flash.action.treemodel.ConstantPool;
import com.jpexs.decompiler.flash.action.Action;
import com.jpexs.decompiler.flash.helpers.Highlighting;
import java.util.ArrayList;
import java.util.HashMap;
@@ -949,7 +949,7 @@ public class Graph {
} else {
ret.addAll(output);
}
GraphPart loopBodyStart = null;
GraphPart loopBodyStart = null;
if (reversed == loop) {
if (expr instanceof LogicalOpItem) {
expr = ((LogicalOpItem) expr).invert();
@@ -957,7 +957,7 @@ public class Graph {
expr = new NotItem(null, expr);
}
}
GraphPart next = part.getNextPartPath(loopContinues);
List<GraphTargetItem> retx = ret;
if ((!loop) || (doWhile && (part.nextParts.size() > 1))) {
@@ -1290,7 +1290,7 @@ public class Graph {
GraphPart part = ret;
while (ip < code.size()) {
if (visited2[ip] || ((ip != startip) && (refs.get(ip).size() > 1))) {
if(lastIp==497){
if (lastIp == 497) {
System.out.println("dff");
}
part.end = lastIp;
@@ -1316,7 +1316,7 @@ public class Graph {
part = gp;
}
}
ip = checkIp(ip);
lastIp = ip;
GraphSourceItem ins = code.get(ip);
@@ -1324,11 +1324,17 @@ public class Graph {
ip++;
continue;
}
if(ins instanceof GraphSourceItemContainer){
ip = code.adr2pos(((GraphSourceItemContainer)ins).getEndAddress());
if (ins instanceof GraphSourceItemContainer) {
GraphSourceItemContainer cnt = (GraphSourceItemContainer) ins;
if (ins instanceof Action) { //TODO: Remove dependency of AVM1
long endAddr = ((Action) ins).getAddress() + cnt.getHeaderSize();
for (long size : cnt.getContainerSizes()) {
endAddr += size;
}
ip = code.adr2pos(endAddr);
}
continue;
}else
if (ins.isExit()) {
} else if (ins.isExit()) {
part.end = ip;
allBlocks.add(part);
break;
@@ -1341,7 +1347,7 @@ public class Graph {
break;
} else if (ins.isBranch()) {
part.end = ip;
allBlocks.add(part);
List<Integer> branches = ins.getBranches(code);
for (int i = 0; i < branches.size(); i++) {