mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 09:51:27 +00:00
Fixed: #2297 AS1/2/3 direct editation - if..else clause broken when using continue/break
This commit is contained in:
+4
-3
@@ -359,9 +359,10 @@ public class AVM2SourceGenerator implements SourceGenerator {
|
||||
}
|
||||
AVM2Instruction ajmp = null;
|
||||
if (onFalse != null) {
|
||||
if (!((!nonempty(onTrue).isEmpty())
|
||||
&& ((onTrue.get(onTrue.size() - 1).definition instanceof ContinueJumpIns)
|
||||
|| ((onTrue.get(onTrue.size() - 1).definition instanceof BreakJumpIns))))) {
|
||||
if (onTrueCmds.isEmpty() ||
|
||||
!((onTrueCmds.get(onTrueCmds.size() - 1) instanceof ContinueItem)
|
||||
|| (onTrueCmds.get(onTrueCmds.size() - 1) instanceof BreakItem))
|
||||
) {
|
||||
ajmp = ins(AVM2Instructions.Jump, 0);
|
||||
onTrue.add(ajmp);
|
||||
}
|
||||
|
||||
+4
-4
@@ -183,10 +183,10 @@ public class ActionSourceGenerator implements SourceGenerator {
|
||||
ifaif.setJumpOffset(onTrueLen);
|
||||
ActionJump ajmp = null;
|
||||
if (onFalse != null) {
|
||||
if (!((!nonempty(onTrue).isEmpty())
|
||||
&& (onTrue.get(onTrue.size() - 1) instanceof ActionJump)
|
||||
&& ((((ActionJump) onTrue.get(onTrue.size() - 1)).isContinue)
|
||||
|| (((ActionJump) onTrue.get(onTrue.size() - 1)).isBreak)))) {
|
||||
if (onTrueCmds.isEmpty() ||
|
||||
!((onTrueCmds.get(onTrueCmds.size() - 1) instanceof ContinueItem)
|
||||
|| (onTrueCmds.get(onTrueCmds.size() - 1) instanceof BreakItem))
|
||||
) {
|
||||
ajmp = new ActionJump(0, charset);
|
||||
ret.add(ajmp);
|
||||
onTrueLen += ajmp.getTotalActionLength();
|
||||
|
||||
Reference in New Issue
Block a user