From 58eb1f38daa2c9f7f153ff93a196be4a4e02e41e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Wed, 10 Feb 2021 21:02:46 +0100 Subject: [PATCH] const can reference other property --- CHANGELOG.md | 2 +- .../decompiler/flash/abc/avm2/AVM2Code.java | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78b646061..aad64b9c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file. - AS3 getslot/setslot in certain situations - #1185 AS3 Incorrect imports in obfuscated files - #1186 Missing import when item is fully qualified -- #1188 AS3 Static initializer - init slot/const only when not referencing other property +- #1188 AS3 Static initializer - init slot only when not referencing other property ## [13.0.1] - 2021-02-09 ### Fixed diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index a83d54fb1..6bd1044ae 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -1947,15 +1947,17 @@ public class AVM2Code implements Cloneable { multinameIndex = ((FullMultinameAVM2Item) ((SetPropertyAVM2Item) ti).propertyName).multinameIndex; value = ((SetPropertyAVM2Item) ti).value; } - Set subItems = value.getAllSubItemsRecursively(); - subItems.add(value); - for (GraphTargetItem item : subItems) { - if ((item instanceof GetPropertyAVM2Item) || (item instanceof GetLexAVM2Item)) { //references other property - continue loopi; - } + if (ti instanceof SetPropertyAVM2Item) { + Set subItems = value.getAllSubItemsRecursively(); + subItems.add(value); + for (GraphTargetItem item : subItems) { + if ((item instanceof GetPropertyAVM2Item) || (item instanceof GetLexAVM2Item)) { //references other property + continue loopi; + } - if (item instanceof LocalRegAVM2Item) { //it is surely in static initializer block, not in slot/const - continue loopi; + if (item instanceof LocalRegAVM2Item) { //it is surely in static initializer block, not in slot/const + continue loopi; + } } } Multiname m = abc.constants.getMultiname(multinameIndex);