AS3 direct editation: try..finally generates pushbyte -1, not pushbyte 255

This commit is contained in:
Jindra Petřík
2021-02-16 22:23:04 +01:00
parent 5b6ec4ef75
commit 86f2f7fdce

View File

@@ -921,9 +921,6 @@ public class AVM2SourceGenerator implements SourceGenerator {
finallySwitchCmds.addAll(toInsList(AssignableAVM2Item.getTemp(localData, this, tempReg2)));
finallySwitchCmds.add(ins(AVM2Instructions.Kill, tempReg2.getVal()));
finallySwitchCmds.add(ins(AVM2Instructions.Throw));
finallySwitchCmds.add(ins(AVM2Instructions.PushByte, 255));
finallySwitchCmds.add(ins(AVM2Instructions.PopScope));
finallySwitchCmds.add(ins(AVM2Instructions.Kill, tempReg.getVal()));
int finSwitchLen = insToBytes(finallySwitchCmds).length;
@@ -933,7 +930,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
preCatches.add(0, fjump);
preCatches.add(0, new ExceptionMarkAVM2Instruction(finallyEx, MARK_E_END));
preCatches.add(0, ins(AVM2Instructions.PushByte, 255));
preCatches.add(0, ins(AVM2Instructions.PushByte, -1));
finallySwitchCmds.add(new ExceptionMarkAVM2Instruction(finallyEx, MARK_E_FINALLYPART));