From 7b15db82b8bcc4a20a34ec6800d41ac24d86263f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 26 Nov 2022 14:58:04 +0100 Subject: [PATCH] Fixed #1891 AS3 - duplicate variable declaration in some cases --- CHANGELOG.md | 2 ++ .../src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb4501218..82d8ac1e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. - [#1890] AS3 - Chained assignments in some special cases - [#1810] AS3 Direct editation - XML attribute handling - [#1810] AS3 Direct editation - Calls inside submethods using this +- [#1891] AS3 - duplicate variable declaration in some cases ## [17.0.2] - 2022-11-22 ### Fixed @@ -2656,6 +2657,7 @@ All notable changes to this project will be documented in this file. [#1888]: https://www.free-decompiler.com/flash/issues/1888 [#1890]: https://www.free-decompiler.com/flash/issues/1890 [#1810]: https://www.free-decompiler.com/flash/issues/1810 +[#1891]: https://www.free-decompiler.com/flash/issues/1891 [#1882]: https://www.free-decompiler.com/flash/issues/1882 [#1880]: https://www.free-decompiler.com/flash/issues/1880 [#1881]: https://www.free-decompiler.com/flash/issues/1881 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 dba6a1a4e..1a3943c0c 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 @@ -2048,6 +2048,11 @@ public class AVM2Code implements Cloneable { sp.setDeclaration(d); declaredPropsDec.add(d); declaredProperties.add(propName.resolvedMultinameName); + + Slot sl = new Slot(new NewActivationAVM2Item(null, null), abc.constants.getMultiname(tsc.name_index)); + declaredSlotsDec.add(d); + declaredSlots.add(sl); + if (subItem == currentItem) { items.set(i, d); } else { @@ -2081,6 +2086,9 @@ public class AVM2Code implements Cloneable { ssti.setDeclaration(d); declaredSlotsDec.add(d); declaredSlots.add(sl); + + declaredPropsDec.add(d); + declaredProperties.add(slotPropertyName); if (subItem == currentItem) { items.set(i, d);