From 12945c56966d29cfd79d30a13a9cd00e2ae9d25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 22 Nov 2021 07:56:56 +0100 Subject: [PATCH] Fixed AS1/2 - loops and switch break/continue vs definefunction --- CHANGELOG.md | 1 + .../flash/action/parser/script/ActionSourceGenerator.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cc2dffa7..b8ce1bc56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. - AS1/2 - Allow nonstandard identifiers in object literal - AS1/2 - Allow globalfunc names as variable identifiers - AS1/2 - Registers in for..in clause, proper define +- AS1/2 - loops and switch break/continue vs definefunction ## [14.5.2] - 2021-11-20 ### Fixed diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java index d49a837b0..8465ac457 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionSourceGenerator.java @@ -196,7 +196,7 @@ public class ActionSourceGenerator implements SourceGenerator { private void fixLoop(List code, int breakOffset, int continueOffset) { int pos = 0; for (Action a : code) { - pos += a.getTotalActionLength(); + pos += a.getBytesLength(); if (a instanceof ActionJump) { ActionJump aj = (ActionJump) a; if (aj.isContinue && (continueOffset != Integer.MAX_VALUE)) {