diff options
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/fernflower/modules/decompiler/StackVarsProcessor.java | 2 | ||||
-rw-r--r-- | src/de/fernflower/modules/decompiler/sforms/SSAUConstructorSparseEx.java | 78 |
2 files changed, 41 insertions, 39 deletions
diff --git a/src/de/fernflower/modules/decompiler/StackVarsProcessor.java b/src/de/fernflower/modules/decompiler/StackVarsProcessor.java index e1f9218..0b64a97 100644 --- a/src/de/fernflower/modules/decompiler/StackVarsProcessor.java +++ b/src/de/fernflower/modules/decompiler/StackVarsProcessor.java @@ -206,6 +206,8 @@ public class StackVarsProcessor { int[] ret = iterateExprent(lst, index, next, mapVarValues, ssa); + //System.out.println("***************** \r\n"+root.toJava()); + if(ret[0] >= 0) { index = ret[0]; } else { diff --git a/src/de/fernflower/modules/decompiler/sforms/SSAUConstructorSparseEx.java b/src/de/fernflower/modules/decompiler/sforms/SSAUConstructorSparseEx.java index 0fdcd47..32c07a9 100644 --- a/src/de/fernflower/modules/decompiler/sforms/SSAUConstructorSparseEx.java +++ b/src/de/fernflower/modules/decompiler/sforms/SSAUConstructorSparseEx.java @@ -247,45 +247,45 @@ public class SSAUConstructorSparseEx { SFormsFastMapDirect varmap = varmaparr[0]; -// // field access -// if(expr.type == Exprent.EXPRENT_FIELD) { -// -// int index; -// if(mapFieldVars.containsKey(expr.id)) { -// index = mapFieldVars.get(expr.id); -// } else { -// index = fieldvarcounter--; -// mapFieldVars.put(expr.id, index); -// -// // ssu graph -// ssuversions.createNode(new VarVersionPaar(index, 1)); -// } -// -// setCurrentVar(varmap, index, 1); -// -// } else if(expr.type == Exprent.EXPRENT_INVOCATION || -// (expr.type == Exprent.EXPRENT_ASSIGNMENT && ((AssignmentExprent)expr).getLeft().type == Exprent.EXPRENT_FIELD) || -// (expr.type == Exprent.EXPRENT_NEW && ((NewExprent)expr).getNewtype().type == CodeConstants.TYPE_OBJECT) || -// expr.type == Exprent.EXPRENT_FUNCTION) { -// -// boolean ismmpp = true; -// -// if(expr.type == Exprent.EXPRENT_FUNCTION) { -// -// ismmpp = false; -// -// FunctionExprent fexpr = (FunctionExprent)expr; -// if(fexpr.getFunctype() >= FunctionExprent.FUNCTION_IMM && fexpr.getFunctype() <= FunctionExprent.FUNCTION_PPI) { -// if(fexpr.getLstOperands().get(0).type == Exprent.EXPRENT_FIELD) { -// ismmpp = true; -// } -// } -// } -// -// if(ismmpp) { -// varmap.removeAllFields(); -// } -// } + // field access + if(expr.type == Exprent.EXPRENT_FIELD) { + + int index; + if(mapFieldVars.containsKey(expr.id)) { + index = mapFieldVars.get(expr.id); + } else { + index = fieldvarcounter--; + mapFieldVars.put(expr.id, index); + + // ssu graph + ssuversions.createNode(new VarVersionPaar(index, 1)); + } + + setCurrentVar(varmap, index, 1); + + } else if(expr.type == Exprent.EXPRENT_INVOCATION || + (expr.type == Exprent.EXPRENT_ASSIGNMENT && ((AssignmentExprent)expr).getLeft().type == Exprent.EXPRENT_FIELD) || + (expr.type == Exprent.EXPRENT_NEW && ((NewExprent)expr).getNewtype().type == CodeConstants.TYPE_OBJECT) || + expr.type == Exprent.EXPRENT_FUNCTION) { + + boolean ismmpp = true; + + if(expr.type == Exprent.EXPRENT_FUNCTION) { + + ismmpp = false; + + FunctionExprent fexpr = (FunctionExprent)expr; + if(fexpr.getFunctype() >= FunctionExprent.FUNCTION_IMM && fexpr.getFunctype() <= FunctionExprent.FUNCTION_PPI) { + if(fexpr.getLstOperands().get(0).type == Exprent.EXPRENT_FIELD) { + ismmpp = true; + } + } + } + + if(ismmpp) { + varmap.removeAllFields(); + } + } if(varassign != null) { |