From e9cc551c37662c48bbd35bf67349c46de5de1105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Sun, 5 Dec 2021 17:29:24 +0100 Subject: [PATCH] Fixed AS3 - direct editation - call on index --- CHANGELOG.md | 1 + .../flash/abc/avm2/parser/script/IndexAVM2Item.java | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c4619e24..cf192352a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. - AS3 - direct editation - bit not - AS3 - direct editation - call on local register - AS3 - direct editation - resolve properties and local regs before types +- AS3 - direct editation - call on index ## [15.0.0] - 2021-11-29 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java index 5a01cd2fe..e6db3a758 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java @@ -154,13 +154,16 @@ public class IndexAVM2Item extends AssignableAVM2Item { } else { return toSourceMerge(localData, generator, object, - call ? ins(AVM2Instructions.Dup) : null, + call ? dupSetTemp(localData, generator, ret_temp) : null, index, + construct ? getTemp(localData, generator, ret_temp) : null, construct ? callargs : null, ins(construct ? AVM2Instructions.ConstructProp : delete ? AVM2Instructions.DeleteProperty : AVM2Instructions.GetProperty, indexPropIndex, construct ? callargs.size() : null), + call ? getTemp(localData, generator, ret_temp) : null, call ? callargs : null, call ? ins(AVM2Instructions.Call, callargs.size()) : null, - needsReturn ? null : ins(AVM2Instructions.Pop)); + needsReturn ? null : ins(AVM2Instructions.Pop), + (call || construct) ? killTemp(localData, generator, Arrays.asList(ret_temp)) : null); } }