From d55f9dcf3ef03961a9b74bea8b2b93a120a7002a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sat, 14 Jan 2023 14:01:11 +0100 Subject: [PATCH] Fixed #1936 AS3 Direct editation - missing pop after call --- CHANGELOG.md | 1 + .../flash/abc/avm2/parser/script/CallAVM2Item.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a11a2e943..f04fd10ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file. - [#1936] AS3 - Scope stack in second pass - [#1936] AS3 Direct editation - handling undefined variables - [#1936] AS3 Direct editation - colliding try..catch variable +- [#1936] AS3 Direct editation - missing pop after call ## [18.3.2] - 2023-01-10 ### Removed diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java index b44f940a7..2d5cbd6a5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/CallAVM2Item.java @@ -48,11 +48,11 @@ public class CallAVM2Item extends AVM2Item { public int line; public List openedNamespaces; - + private AbcIndexing abcIndex; public CallAVM2Item(List openedNamespaces, int line, GraphTargetItem name, List arguments, AbcIndexing abcIndex) { - super(null, null, NOPRECEDENCE); + super(null, null, NOPRECEDENCE); this.openedNamespaces = openedNamespaces; this.name = name; this.arguments = arguments; @@ -168,7 +168,7 @@ public class CallAVM2Item extends AVM2Item { return ((NamespacedAVM2Item) callable).toSource(localData, generator, needsReturn, true, arguments, false, false); } - return toSourceMerge(localData, generator, callable, ins(AVM2Instructions.GetGlobalScope), arguments, ins(AVM2Instructions.Call, arguments.size())); + return toSourceMerge(localData, generator, callable, ins(AVM2Instructions.GetGlobalScope), arguments, ins(AVM2Instructions.Call, arguments.size()), needsReturn ? null : ins(AVM2Instructions.Pop)); } @Override