Fixed #1227 AS3 avoid recursion (stackoverflow) caused by newfunction instruction

This commit is contained in:
Jindra Petřík
2021-02-11 11:10:56 +01:00
parent df482b5343
commit 66b0d0bb13
23 changed files with 91 additions and 61 deletions

View File

@@ -1759,9 +1759,6 @@ public class Graph {
boolean vCanHandleVisited = canHandleVisited(localData, part);
/*if (part.start == 25) {
new RuntimeException().printStackTrace();
}*/
if (vCanHandleVisited) {
if (visited.contains(part)) {
String labelName = "addr" + part.start;

View File

@@ -21,7 +21,9 @@ import com.jpexs.decompiler.flash.abc.avm2.AVM2ConstantPool;
import com.jpexs.decompiler.flash.action.model.ConstantPool;
import com.jpexs.decompiler.graph.DottedChain;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
*
@@ -39,6 +41,8 @@ public class LocalData {
public List<DottedChain> fullyQualifiedNames;
public Set<Integer> seenMethods = new HashSet<>();
public ABC abc;
public static LocalData create(ConstantPool constants) {
@@ -47,12 +51,13 @@ public class LocalData {
return localData;
}
public static LocalData create(ABC abc, HashMap<Integer, String> localRegNames, List<DottedChain> fullyQualifiedNames) {
public static LocalData create(ABC abc, HashMap<Integer, String> localRegNames, List<DottedChain> fullyQualifiedNames, Set<Integer> seenMethods) {
LocalData localData = new LocalData();
localData.abc = abc;
localData.constantsAvm2 = abc.constants;
localData.localRegNames = localRegNames;
localData.fullyQualifiedNames = fullyQualifiedNames;
localData.seenMethods = seenMethods;
return localData;
}
}