From 5b0e9e494a30e36de7787693841db2425d322dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Sat, 22 Dec 2012 16:39:21 +0100 Subject: [PATCH] AS3: Chained assignments --- .../com/jpexs/asdec/abc/avm2/AVM2Code.java | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java index 4a8734d5d..53fe30790 100644 --- a/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java +++ b/trunk/src/com/jpexs/asdec/abc/avm2/AVM2Code.java @@ -871,6 +871,7 @@ public class AVM2Code { private List unknownJumps; private List finallyJumps; private List parsedExceptions; + private List ignoredIns; private String stripBrackets(String s) { if (s.startsWith("(") && (s.endsWith(")"))) { @@ -1050,7 +1051,7 @@ public HashMap getLocalRegNamesFromDebug(ABC abc){ } private ConvertOutput toSource(boolean isStatic, int classIndex, java.util.HashMap localRegs, Stack stack, Stack scopeStack, ABC abc, ConstantPool constants, MethodInfo method_info[], MethodBody body, int start, int end,HashMap localRegNames) throws ConvertException { - boolean debugMode = false; + boolean debugMode = true; if (debugMode) System.out.println("OPEN SubSource:" + start + "-" + end + " " + code.get(start).toString() + " to " + code.get(end).toString()); //if(true) return ""; @@ -1068,6 +1069,11 @@ public HashMap getLocalRegNamesFromDebug(ABC abc){ iploop: while (ip <= end) { + if(ignoredIns.contains(ip)) + { + ip++; + continue; + } addr = pos2adr(ip); int ipfix=fixIPAfterDebugLine(ip); int addrfix=pos2adr(ipfix); @@ -1671,12 +1677,24 @@ public HashMap getLocalRegNamesFromDebug(ABC abc){ ip++; addr = pos2adr(ip); break; - } else if (insAfter.definition instanceof SetLocalTypeIns) { - /*if (isKilled(((SetLocalTypeIns) insAfter.definition).getRegisterId(insAfter), ip + 2, end)) { - ip += 2; - addr = pos2adr(ip); - break; - } else {*/ + } else if (insAfter.definition instanceof SetLocalTypeIns) { + //chained assignments + int reg=(((SetLocalTypeIns)insAfter.definition).getRegisterId(insAfter)); + for(int t=ip+1;t getLocalRegNamesFromDebug(ABC abc){ unknownJumps = new ArrayList(); finallyJumps = new ArrayList(); parsedExceptions = new ArrayList(); + ignoredIns = new ArrayList(); List list; String s = ""; HashMap localRegs = new HashMap();