From ab34d923515eaddc6054e01344cc52366ccc995c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 12 Feb 2021 10:44:42 +0100 Subject: [PATCH] Fixed #1596 Infinite loop when sorting traits according to dependencies --- CHANGELOG.md | 1 + .../com/jpexs/decompiler/flash/abc/types/traits/Traits.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a97a37b75..c8016ae14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. - #1227 AS3 avoid recursion (stackoverflow) caused by newfunction instruction - #1360 Precedence of increment/decrement operations - #1407 NullPointer on Save as in BinaryData SWF subtree +- #1596 Infinite loop when sorting traits according to dependencies ## [13.0.2] - 2021-02-10 ### Changed diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java index f8a044ae8..2b097dde2 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/traits/Traits.java @@ -17,6 +17,7 @@ package com.jpexs.decompiler.flash.abc.types.traits; import com.jpexs.decompiler.flash.abc.ABC; +import com.jpexs.decompiler.flash.abc.avm2.model.FindPropertyAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.FullMultinameAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.GetLexAVM2Item; import com.jpexs.decompiler.flash.abc.avm2.model.GetPropertyAVM2Item; @@ -184,7 +185,7 @@ public class Traits implements Cloneable, Serializable { if (si instanceof GetPropertyAVM2Item) { GetPropertyAVM2Item getProp = (GetPropertyAVM2Item) si; Multiname sm1 = abc.constants.getMultiname(((FullMultinameAVM2Item) getProp.propertyName).multinameIndex); - if (sm1.equals(m2)) { + if (getProp.object instanceof FindPropertyAVM2Item && sm1.equals(m2)) { ordered.add(j + 1, o1); ordered.remove(i); i--;