From 0498fadbb4da679725d78df4bbd12a4e0a0c38e0 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sat, 22 Aug 2015 21:01:41 +0200 Subject: [PATCH] check the needed stack size before translating the instruction to avoid throwing that much emptystackexceptions during deobfuscarion --- .../deobfuscation/AVM2DeobfuscatorSimple.java | 6 ++++++ .../avm2/instructions/AVM2Instruction.java | 4 ++++ .../avm2/instructions/DeobfuscatePopIns.java | 5 +++++ .../instructions/InstructionDefinition.java | 4 ++++ .../avm2/instructions/arithmetic/AddIIns.java | 5 +++++ .../avm2/instructions/arithmetic/AddIns.java | 5 +++++ .../avm2/instructions/bitwise/BitAndIns.java | 5 +++++ .../instructions/executing/CallMethodIns.java | 5 +++++ .../executing/CallPropVoidIns.java | 6 ++++++ .../abc/avm2/instructions/jumps/IfNGtIns.java | 5 +++++ .../abc/avm2/instructions/jumps/IfNeIns.java | 5 +++++ .../localregs/SetLocalTypeIns.java | 5 +++++ .../instructions/other/GetPropertyIns.java | 19 +++++++++++++++++++ .../instructions/other/InitPropertyIns.java | 6 ++++++ .../instructions/other/SetPropertyIns.java | 5 +++++ .../abc/avm2/instructions/stack/DupIns.java | 5 +++++ .../avm2/instructions/stack/PushScopeIns.java | 5 +++++ .../avm2/instructions/types/ApplyTypeIns.java | 5 +++++ .../avm2/instructions/types/AsTypeIns.java | 5 +++++ .../instructions/types/AsTypeLateIns.java | 5 +++++ .../avm2/instructions/types/CoerceIns.java | 5 +++++ .../avm2/instructions/types/CoerceSIns.java | 5 +++++ .../avm2/instructions/types/ConvertIIns.java | 5 +++++ 23 files changed, 130 insertions(+) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java index 4f67df2e1..4106aa792 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/deobfuscation/AVM2DeobfuscatorSimple.java @@ -257,6 +257,12 @@ public class AVM2DeobfuscatorSimple implements SWFDecompilerListener { } } } else { + // do not throw EmptyStackException, much faster + int requiredStackSize = ins.getRequiredStackSize(); + if (stack.size() < requiredStackSize) { + return; + } + ins.translate(localData, stack, output, Graph.SOP_USE_STATIC, ""); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java index c1a9aa0e5..4b23a3f19 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/AVM2Instruction.java @@ -340,6 +340,10 @@ public class AVM2Instruction implements Cloneable, GraphSourceItem { aLocalData.constants, this, aLocalData.methodInfo, output, aLocalData.methodBody, aLocalData.abc, aLocalData.localRegNames, aLocalData.fullyQualifiedNames, null, aLocalData.localRegAssignmentIps, aLocalData.ip, aLocalData.refs, aLocalData.code); } + public int getRequiredStackSize() { + return definition.getRequiredStackSize(this); + } + @Override public boolean isJump() { return (definition instanceof JumpIns) || (fixedBranch > -1); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java index b444fb3f2..e0c8ca7a9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/DeobfuscatePopIns.java @@ -43,4 +43,9 @@ public class DeobfuscatePopIns extends PopIns { public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) { stack.pop(); //Just ignore the value } + + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 1; + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java index 923311391..7f313f29e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/InstructionDefinition.java @@ -91,6 +91,10 @@ public class InstructionDefinition implements Serializable { public void translate(boolean isStatic, int scriptIndex, int classIndex, HashMap localRegs, TranslateStack stack, ScopeStack scopeStack, AVM2ConstantPool constants, AVM2Instruction ins, List method_info, List output, MethodBody body, ABC abc, HashMap localRegNames, List fullyQualifiedNames, String path, HashMap localRegsAssignmentIps, int ip, HashMap> refs, AVM2Code code) throws InterruptedException { } + public int getRequiredStackSize(AVM2Instruction ins) { + return 0; + } + protected FullMultinameAVM2Item resolveMultiname(TranslateStack stack, AVM2ConstantPool constants, int multinameIndex, AVM2Instruction ins) { GraphTargetItem ns = null; GraphTargetItem name = null; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java index 429ff85e2..53cf8fd4d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIIns.java @@ -44,6 +44,11 @@ public class AddIIns extends AddIns { stack.push(new AddAVM2Item(ins, v1, v2)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 2; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -2 + 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java index 4291faae6..142ca5f79 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/arithmetic/AddIns.java @@ -67,6 +67,11 @@ public class AddIns extends InstructionDefinition { stack.push(new AddAVM2Item(ins, v1, v2)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 2; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -2 + 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java index 9b709d187..71cb2cd57 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/bitwise/BitAndIns.java @@ -53,6 +53,11 @@ public class BitAndIns extends InstructionDefinition { stack.push(new BitAndAVM2Item(ins, v1, v2)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 2; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -2 + 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java index 1ecf0b267..ca3ff1dce 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallMethodIns.java @@ -65,6 +65,11 @@ public class CallMethodIns extends InstructionDefinition { stack.push(new CallMethodAVM2Item(ins, receiver, methodName, args)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return ins.operands[1] + 1; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -1 + 1 - ins.operands[1]; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java index 189d42f81..58938d7a2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallPropVoidIns.java @@ -72,6 +72,12 @@ public class CallPropVoidIns extends InstructionDefinition { output.add(new CallPropertyAVM2Item(ins, true, receiver, multiname, args)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return ins.operands[1] + 1; + // todo: honfika: add resolveMultiname stack size + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { int ret = -ins.operands[1] - 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java index 64df6103b..02b8400bd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNGtIns.java @@ -53,6 +53,11 @@ public class IfNGtIns extends InstructionDefinition implements IfTypeIns { stack.push(new GtAVM2Item(ins, v1, v2)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 2; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -2; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java index a77c154b7..51bab5975 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/jumps/IfNeIns.java @@ -53,6 +53,11 @@ public class IfNeIns extends InstructionDefinition implements IfTypeIns { stack.push(new EqAVM2Item(ins, v1, v2)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 2; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -2; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java index fbde199d0..15c252d7a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/localregs/SetLocalTypeIns.java @@ -124,6 +124,11 @@ public abstract class SetLocalTypeIns extends InstructionDefinition implements S output.add(new SetLocalAVM2Item(ins, regId, value)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 1; + } + @Override public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { return AVM2Item.localRegName(localRegNames, getRegisterId(ins)); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java index ade3c1f2c..1df7d5e9b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/GetPropertyIns.java @@ -46,6 +46,25 @@ public class GetPropertyIns extends InstructionDefinition { stack.push(new GetPropertyAVM2Item(ins, obj, multiname)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + int ret = 1; + int multinameIndex = ins.operands[0]; + //Note: In official compiler, the stack can be wrong(greater) for some MULTINAMEL/A, e.g. increments + /* + var arr=[1,2,3]; + return arr[2]++; + */ + /* todo: honfika + if (abc.constants.getMultiname(multinameIndex).needsName()) { + ret--; + } + if (abc.constants.getMultiname(multinameIndex).needsNs()) { + ret--; + }*/ + return ret; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { int ret = -1 + 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java index 5b3721f8e..26d03f19b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/InitPropertyIns.java @@ -48,6 +48,12 @@ public class InitPropertyIns extends InstructionDefinition { output.add(new InitPropertyAVM2Item(ins, obj, multiname, val)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 2; + // todo: honfika: add resolveMultiname stack size + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { int ret = -2; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java index 2bcdc43cb..eb5b04e0d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/other/SetPropertyIns.java @@ -143,6 +143,11 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 2; + } + @Override public String getObject(Stack stack, ABC abc, AVM2Instruction ins, List output, MethodBody body, HashMap localRegNames, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java index d397f9a97..ab7a3f643 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/DupIns.java @@ -54,6 +54,11 @@ public class DupIns extends InstructionDefinition { } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 1; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -1 + 2; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java index d7005acd9..1d5d8e062 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/stack/PushScopeIns.java @@ -47,6 +47,11 @@ public class PushScopeIns extends InstructionDefinition { scopeStack.push(stack.pop()); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 1; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java index cc09fe1c6..06f6a4e2e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ApplyTypeIns.java @@ -61,6 +61,11 @@ public class ApplyTypeIns extends InstructionDefinition { stack.push(new ApplyTypeAVM2Item(ins, stack.pop(), params)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return ins.operands[0]; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -ins.operands[0] - 1 + 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java index edb982171..cbcb85f7a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeIns.java @@ -56,6 +56,11 @@ public class AsTypeIns extends InstructionDefinition { stack.push(new AsTypeAVM2Item(ins, val, new FullMultinameAVM2Item(ins, ins.operands[0]))); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 1; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -1 + 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java index 5c6079529..bbf04f615 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/AsTypeLateIns.java @@ -54,6 +54,11 @@ public class AsTypeLateIns extends InstructionDefinition { stack.push(new AsTypeAVM2Item(ins, val, cls)); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 2; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -2 + 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java index 2b6147fab..dc8d33024 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceIns.java @@ -51,6 +51,11 @@ public class CoerceIns extends InstructionDefinition implements CoerceOrConvertT stack.push(new CoerceAVM2Item(ins, stack.pop(), PropertyAVM2Item.multinameToType(multinameIndex, constants))); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 1; + } + @Override public GraphTargetItem getTargetType(AVM2ConstantPool constants, AVM2Instruction ins, List fullyQualifiedNames) { int multinameIndex = ins.operands[0]; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java index dc8ae1403..8cec49ea3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/CoerceSIns.java @@ -50,6 +50,11 @@ public class CoerceSIns extends InstructionDefinition implements CoerceOrConvert stack.push(new CoerceAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 1; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -1 + 1; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java index 594d1e1c1..1bd40bb89 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/types/ConvertIIns.java @@ -66,6 +66,11 @@ public class ConvertIIns extends InstructionDefinition implements CoerceOrConver stack.push(new ConvertAVM2Item(ins, stack.pop(), getTargetType(constants, ins, fullyQualifiedNames))); } + @Override + public int getRequiredStackSize(AVM2Instruction ins) { + return 1; + } + @Override public int getStackDelta(AVM2Instruction ins, ABC abc) { return -1 + 1;