From 485dabc2d2824de6ae9d6557d5870631c830ae01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Tue, 9 Feb 2021 19:25:43 +0100 Subject: [PATCH] Fixed: AS3 p-code traits of bodys of inner methods --- CHANGELOG.md | 1 + .../decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46f5f5fc3..ab562bfe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. ### Fixed - AS3 break loop in catch clause - AS3 inner functions scope (setslot/getslot) +- AS3 p-code traits of bodys of inner methods ## [13.0.0] - 2021-02-08 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java index b3312a4df..ca6356f86 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java @@ -640,15 +640,15 @@ public class ASM3Parser { } if (symb.type == ParsedSymbol.TYPE_KEYWORD_TRAIT) { blockStack.push(symb.type); - if (trait == null) { - throw new AVM2ParseException("No trait expected", lexer.yyline()); - } if (blockStack.contains(ParsedSymbol.TYPE_KEYWORD_BODY)) { lexer.pushback(symb); TraitSlotConst tsc = new TraitSlotConst(); parseSlotConst(abc, lexer, constants, tsc); body.traits.addTrait(tsc); } else { + if (trait == null) { + throw new AVM2ParseException("No trait expected", lexer.yyline()); + } symb = lexer.lex(); switch (symb.type) { case ParsedSymbol.TYPE_KEYWORD_METHOD: