From 237b9ba1dc8fb69abe4411a0da2225239ea43f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 13 Nov 2023 22:01:04 +0100 Subject: [PATCH] Fixed #2111 AS3 direct editation - access class in class initializer --- CHANGELOG.md | 2 ++ .../flash/abc/avm2/parser/script/AVM2SourceGenerator.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e863aa08..b3b140f9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ All notable changes to this project will be documented in this file. - Debugging - properly getting variable value through getter - [#2123] FLA export - IndexOutOfBounds in shape fixer - [#2123] FLA export - morphshapes fixer +- [#2111] AS3 direct editation - access class in class initializer ### Removed - [#2123] FLA export - Using shape fixer for morphshapes (needs something better) @@ -3278,6 +3279,7 @@ Major version of SWF to XML export changed to 2. [#2000]: https://www.free-decompiler.com/flash/issues/2000 [#2116]: https://www.free-decompiler.com/flash/issues/2116 [#2122]: https://www.free-decompiler.com/flash/issues/2122 +[#2111]: https://www.free-decompiler.com/flash/issues/2111 [#1130]: https://www.free-decompiler.com/flash/issues/1130 [#1220]: https://www.free-decompiler.com/flash/issues/1220 [#1717]: https://www.free-decompiler.com/flash/issues/1717 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index f8f89ed70..9829791b0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -2909,7 +2909,9 @@ public class AVM2SourceGenerator implements SourceGenerator { } } } - if (globalSlotId > 0) { + if (localData.isStatic && item.toString().equals(currentFullClassName)) { + return Arrays.asList(ins(AVM2Instructions.GetLocal0)); + } else if (globalSlotId > 0) { return GraphTargetItem.toSourceMerge(localData, this, ins(AVM2Instructions.GetGlobalScope), ins(AVM2Instructions.GetSlot, globalSlotId)); } else { return GraphTargetItem.toSourceMerge(localData, this, ins(AVM2Instructions.GetLex, resolveType(localData, item, abcIndex)));