From 703b7cc71d5dfd9441fc139314ee146844670c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 31 Aug 2025 17:20:41 +0200 Subject: [PATCH] move to stack fix --- .../flash/abc/avm2/instructions/InstructionDefinition.java | 3 ++- .../flash/abc/avm2/instructions/executing/CallIns.java | 1 + .../flash/abc/avm2/instructions/other/GetPropertyIns.java | 3 ++- .../flash/abc/avm2/instructions/other/SetPropertyIns.java | 5 +++-- 4 files changed, 8 insertions(+), 4 deletions(-) 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 ec1108022..eac6265ea 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 @@ -1423,6 +1423,7 @@ public abstract class InstructionDefinition implements Serializable { DuplicateSourceItem ds = (DuplicateSourceItem) stack.peek(); if (st.tempIndex == ds.tempIndex) { output.remove(output.size() - 1); + stack.moveToStack(output); } } stack.push(stack.pop().value); @@ -1463,7 +1464,7 @@ public abstract class InstructionDefinition implements Serializable { } else { result = new SetPropertyAVM2Item(ins, localData.lineStartInstruction, obj, multiname, value, type.getVal(), callType.getVal(), isStatic.getVal()); } - SetPropertyIns.handleCompound(localData, obj, multiname, value, output, result); + SetPropertyIns.handleCompound(localData, obj, multiname, value, output, stack, result); SetTypeIns.handleResult(value, stack, output, localData, (GraphTargetItem) result, -1, type.getVal()); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java index d82761932..cd9e0323b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/instructions/executing/CallIns.java @@ -100,6 +100,7 @@ public class CallIns extends InstructionDefinition { SetTemporaryItem st = (SetTemporaryItem) output.get(output.size() - 1); if (st.tempIndex == d.tempIndex) { output.remove(output.size() - 1); + stack.moveToStack(output); } } } else if (getProperty.object instanceof SetLocalAVM2Item) { 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 7f78ee007..5b84f7e30 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 @@ -111,7 +111,7 @@ public class GetPropertyIns extends InstructionDefinition { Set usage = localData.getSetLocalUsages(localData.code.adr2pos(setLocal.getSrc().getAddress())); if (usage.size() == 2) { findPropName.name = setLocal.value; - output.remove(output.size() - 1); + output.remove(output.size() - 1); } } } @@ -158,6 +158,7 @@ public class GetPropertyIns extends InstructionDefinition { } } } + stack.moveToStack(output); } } Reference isStatic = new Reference<>(false); 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 03b36d5ce..d9906e4ce 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 @@ -58,7 +58,7 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns handleSetProperty(false, localData, stack, ins, output, path); } - public static void handleCompound(AVM2LocalData localData, GraphTargetItem obj, FullMultinameAVM2Item multiname, GraphTargetItem value, List output, SetTypeAVM2Item result) { + public static void handleCompound(AVM2LocalData localData, GraphTargetItem obj, FullMultinameAVM2Item multiname, GraphTargetItem value, List output, TranslateStack stack, SetTypeAVM2Item result) { if (value instanceof LocalRegAVM2Item) { LocalRegAVM2Item locVal = (LocalRegAVM2Item) value; if (multiname.name instanceof LocalRegAVM2Item) { @@ -111,7 +111,8 @@ public class SetPropertyIns extends InstructionDefinition implements SetTypeIns if (!output.isEmpty() && output.get(output.size() - 1) instanceof SetTemporaryItem) { SetTemporaryItem st = (SetTemporaryItem) output.get(output.size() - 1); if (st.tempIndex == d.tempIndex) { - output.remove(output.size() - 1); + output.remove(output.size() - 1); + stack.moveToStack(output); } } }