move to stack fix

This commit is contained in:
Jindra Petřík
2025-08-31 17:20:41 +02:00
parent d57e2cae31
commit 703b7cc71d
4 changed files with 8 additions and 4 deletions

View File

@@ -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());
}

View File

@@ -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) {

View File

@@ -111,7 +111,7 @@ public class GetPropertyIns extends InstructionDefinition {
Set<Integer> 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<Boolean> isStatic = new Reference<>(false);

View File

@@ -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<GraphTargetItem> output, SetTypeAVM2Item result) {
public static void handleCompound(AVM2LocalData localData, GraphTargetItem obj, FullMultinameAVM2Item multiname, GraphTargetItem value, List<GraphTargetItem> 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);
}
}
}