From 8186245151ad13d9c4f7ca3a2628210b697b8f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Fri, 5 Mar 2021 15:18:00 +0100 Subject: [PATCH] Fixed: Goto declaration - exception when exists QName with 0 namespace index --- CHANGELOG.md | 1 + .../decompiler/flash/abc/types/Multiname.java | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df15ebef9..046aeb3fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ All notable changes to this project will be documented in this file. - #1298 AS1 colon syntax handling - #1298 AS1 direct editation of add,eq,ne and such operations - #1260 AS1/2 direct editation - is/as/:: are not reserved operators +- Goto declaration - exception when exists QName with 0 namespace index ### Removed - #1631 ActiveX Flash component download in windows installer diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java index c0329828f..389e158ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Multiname.java @@ -532,13 +532,19 @@ public class Multiname { } Namespace otherNs = other.getSingleNamespace(otherCpool); Namespace thisNs = getSingleNamespace(thisCpool); - if (otherNs.kind != thisNs.kind) { - return false; + if (thisNs != null && otherNs != null) { + if (otherNs.kind != thisNs.kind) { + return false; + } + if (otherNs.kind == Namespace.KIND_PRIVATE) { + return false; + } + if (!Objects.equals(otherNs.getName(otherCpool).toRawString(), thisNs.getName(thisCpool).toRawString())) { + return false; + } } - if (otherNs.kind == Namespace.KIND_PRIVATE) { - return false; - } - if (!Objects.equals(otherNs.getName(otherCpool).toRawString(), thisNs.getName(thisCpool).toRawString())) { + + if ((thisNs == null && otherNs != null) || (otherNs == null && thisNs != null)) { return false; }