const can reference other property

This commit is contained in:
Jindra Petřík
2021-02-10 21:02:46 +01:00
parent c573e57976
commit 58eb1f38da
2 changed files with 11 additions and 9 deletions

View File

@@ -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

View File

@@ -1947,15 +1947,17 @@ public class AVM2Code implements Cloneable {
multinameIndex = ((FullMultinameAVM2Item) ((SetPropertyAVM2Item) ti).propertyName).multinameIndex;
value = ((SetPropertyAVM2Item) ti).value;
}
Set<GraphTargetItem> 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<GraphTargetItem> 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);