Issue #43, AS1/2: Ternary operator(and more...) fix

This commit is contained in:
Jindra Petk
2013-03-19 22:03:16 +01:00
parent 9cea9b6858
commit c4f59ec2a2

View File

@@ -529,11 +529,15 @@ public class SWFInputStream extends InputStream {
stack.pop();
getConstantPool(localData, stack, output, code, condition ? (code.adr2pos(((ActionIf) ins).getAddress() + ((ActionIf) ins).getBytes(code.version).length + ((ActionIf) ins).offset)) : ip + 1, ip, constantPools, visited);
} else {
if(ins instanceof ActionIf){
stack.pop();
}
visited.add(ip);
List<Integer> branches = ins.getBranches(code);
for (int b : branches) {
Stack<GraphTargetItem> brStack=(Stack<GraphTargetItem>)stack.clone();
if (b >= 0) {
getConstantPool(localData, stack, output, code, b, ip, constantPools, visited);
getConstantPool(localData, brStack, output, code, b, ip, constantPools, visited);
} else {
if (debugMode) {
System.out.println("Negative branch:" + b);