mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 16:28:10 +00:00
AS3 direct editation - do not add popscope twice when continue/break as last statement in catch block
This commit is contained in:
@@ -849,8 +849,14 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
localData.catchesOpenedLoops.remove(localData.catchesOpenedLoops.size() - 1);
|
||||
localData.scopeStack.remove(localData.scopeStack.size() - 1);
|
||||
localData.catchesTempRegs.remove(localData.catchesTempRegs.size() - 1);
|
||||
catchCmd.add(ins(AVM2Instructions.PopScope));
|
||||
catchCmd.addAll(toInsList(AssignableAVM2Item.killTemp(localData, this, Arrays.asList(tempReg))));
|
||||
if (!item.catchCommands.get(c).isEmpty()
|
||||
&& ((item.catchCommands.get(c).get(item.catchCommands.get(c).size() - 1) instanceof ContinueItem)
|
||||
|| (item.catchCommands.get(c).get(item.catchCommands.get(c).size() - 1) instanceof BreakItem))) {
|
||||
AssignableAVM2Item.killRegister(localData, this, tempReg.getVal());
|
||||
} else {
|
||||
catchCmd.add(ins(AVM2Instructions.PopScope));
|
||||
catchCmd.addAll(toInsList(AssignableAVM2Item.killTemp(localData, this, Arrays.asList(tempReg))));
|
||||
}
|
||||
catchCmds.add(catchCmd);
|
||||
}
|
||||
for (int c = item.catchCommands.size() - 1; c >= 0; c--) {
|
||||
|
||||
@@ -1736,9 +1736,10 @@ public class ActionScript3Parser {
|
||||
e.setSlotNumber(1);
|
||||
e.setSlotScope(Integer.MAX_VALUE); //will be changed later
|
||||
expectedType(SymbolType.PARENT_CLOSE);
|
||||
List<GraphTargetItem> cc = new ArrayList<>();
|
||||
List<AssignableAVM2Item> catchVars = new ArrayList<>();
|
||||
cc.add(command(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, true, catchVars));
|
||||
expectedType(SymbolType.CURLY_OPEN);
|
||||
List<GraphTargetItem> cc = commands(allOpenedNamespaces, thisType, pkg, needsActivation, importedClasses, openedNamespaces, loops, loopLabels, registerVars, inFunction, inMethod, forinlevel, catchVars);
|
||||
expectedType(SymbolType.CURLY_CLOSE);
|
||||
catchesVars.add(catchVars);
|
||||
variables.addAll(catchVars);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user