diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java index 67c4a3070..b8c9b4e29 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/AVM2Code.java @@ -1214,8 +1214,16 @@ public class AVM2Code implements Cloneable { * @param end * @return */ - public boolean isKilled(int regName, int start, int end) { - return killedRegs.contains(regName); + public boolean isKilled(int regName, int start, int end) { + if(!killedRegs.containsKey(regName)){ + return false; + } + for(int ip:killedRegs.get(regName)){ + if(ip>=start && ip<=end){ + return true; + } + } + return false; } private int toSourceCount = 0; @@ -1231,9 +1239,10 @@ public class AVM2Code implements Cloneable { return localRegNames; } - private Set killedRegs=new HashSet(); + private Map> killedRegs=new HashMap>(); public void calcKilledStats(MethodBody body){ + killedRegs.clear(); try { HashMap> vis=visitCode(body); for(int k=0;k()); + } + killedRegs.get(regid).add(k); } } @@ -1250,7 +1263,7 @@ public class AVM2Code implements Cloneable { } } - public List clearTemporaryRegisters(List output) { + public List clearTemporaryRegisters(List output) { for (int i = 0; i < output.size(); i++) { if (output.get(i) instanceof SetLocalAVM2Item) { if (isKilled(((SetLocalAVM2Item) output.get(i)).regIndex, 0, code.size() - 1)) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java index 6ce7ce3e7..7db686022 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/graph/AVM2Graph.java @@ -12,7 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.abc.avm2.graph; import com.jpexs.decompiler.flash.BaseLocalData;