From c4f59ec2a2568414ce330686f7bcb142fdc05bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Tue, 19 Mar 2013 22:03:16 +0100 Subject: [PATCH] Issue #43, AS1/2: Ternary operator(and more...) fix --- trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 818dc477c..98f42850e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -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 branches = ins.getBranches(code); for (int b : branches) { + Stack brStack=(Stack)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);