Fixed AS3 getslot/setslot in certain situations

This commit is contained in:
Jindra Petřík
2021-02-10 15:24:43 +01:00
parent 253b53dde1
commit 273173771f
3 changed files with 10 additions and 4 deletions
@@ -45,7 +45,9 @@ public class GetSlotIns extends InstructionDefinition {
GraphTargetItem obj = objinreg.getThroughRegister();
Reference<GraphTargetItem> realObj = new Reference<>(null);
Multiname slotname = InstructionDefinition.searchSlotName(slotIndex, localData, obj, realObj);
obj = realObj.getVal();
if (realObj.getVal() != null) {
obj = realObj.getVal();
}
stack.push(new GetSlotAVM2Item(ins, localData.lineStartInstruction, obj, objinreg, slotIndex, slotname));
}
@@ -70,10 +70,13 @@ public class SetSlotIns extends InstructionDefinition implements SetTypeIns {
GraphTargetItem objnoreg = obj;
obj = obj.getThroughRegister();
Reference<GraphTargetItem> realObj = new Reference<>(null);
Multiname slotname = InstructionDefinition.searchSlotName(slotIndex, localData, obj, realObj);
Reference<GraphTargetItem> realObjRef = new Reference<>(null);
Multiname slotname = InstructionDefinition.searchSlotName(slotIndex, localData, obj, realObjRef);
obj = realObj.getVal();
GraphTargetItem realObj = realObjRef.getVal();
if (realObj != null) {
obj = realObj;
}
if (slotname != null) {
if (value instanceof LocalRegAVM2Item) {