From 3b9b180d94cd259f34cf05e7275fe29e309103e2 Mon Sep 17 00:00:00 2001 From: Stiver Date: Mon, 4 Aug 2014 20:44:23 +0200 Subject: [PATCH] Fixed hang-up issue on ObjectOutputStream --- .../modules/decompiler/exps/FunctionExprent.java | 10 ++++++++++ .../decompiler/sforms/SSAUConstructorSparseEx.java | 13 +++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/de/fernflower/modules/decompiler/exps/FunctionExprent.java b/src/de/fernflower/modules/decompiler/exps/FunctionExprent.java index e0cebe4..2610b33 100644 --- a/src/de/fernflower/modules/decompiler/exps/FunctionExprent.java +++ b/src/de/fernflower/modules/decompiler/exps/FunctionExprent.java @@ -490,6 +490,16 @@ public class FunctionExprent extends Exprent { return "--"+wrapOperandString(lstOperands.get(0), true, indent); case FUNCTION_INSTANCEOF: return wrapOperandString(lstOperands.get(0), true, indent)+" instanceof "+wrapOperandString(lstOperands.get(1), true, indent); + case FUNCTION_LCMP: // shouldn't appear in the final code + return "__lcmp__("+wrapOperandString(lstOperands.get(0), true, indent)+","+wrapOperandString(lstOperands.get(1), true, indent)+")"; + case FUNCTION_FCMPL: // shouldn't appear in the final code + return "__fcmpl__("+wrapOperandString(lstOperands.get(0), true, indent)+","+wrapOperandString(lstOperands.get(1), true, indent)+")"; + case FUNCTION_FCMPG: // shouldn't appear in the final code + return "__fcmpg__("+wrapOperandString(lstOperands.get(0), true, indent)+","+wrapOperandString(lstOperands.get(1), true, indent)+")"; + case FUNCTION_DCMPL: // shouldn't appear in the final code + return "__dcmpl__("+wrapOperandString(lstOperands.get(0), true, indent)+","+wrapOperandString(lstOperands.get(1), true, indent)+")"; + case FUNCTION_DCMPG: // shouldn't appear in the final code + return "__dcmpg__("+wrapOperandString(lstOperands.get(0), true, indent)+","+wrapOperandString(lstOperands.get(1), true, indent)+")"; } if(functype <= FUNCTION_I2S) { diff --git a/src/de/fernflower/modules/decompiler/sforms/SSAUConstructorSparseEx.java b/src/de/fernflower/modules/decompiler/sforms/SSAUConstructorSparseEx.java index 32c07a9..ba86aa2 100644 --- a/src/de/fernflower/modules/decompiler/sforms/SSAUConstructorSparseEx.java +++ b/src/de/fernflower/modules/decompiler/sforms/SSAUConstructorSparseEx.java @@ -110,9 +110,9 @@ public class SSAUConstructorSparseEx { HashSet updated = new HashSet(); do { - //System.out.println("~~~~~~~~~~~~~ \r\n"+root.toJava()); +// System.out.println("~~~~~~~~~~~~~ \r\n"+root.toJava()); ssaStatements(dgraph, updated, false); - //System.out.println("~~~~~~~~~~~~~ \r\n"+root.toJava()); +// System.out.println("~~~~~~~~~~~~~ \r\n"+root.toJava()); } while(!updated.isEmpty()); @@ -142,6 +142,15 @@ public class SSAUConstructorSparseEx { varmaparr[1] = varmaparr[0]; } + // quick solution: 'dummy' field variables should not cross basic block borders (otherwise problems e.g. with finally loops - usage without assignment in a loop) + // For the full solution consider adding a dummy assignment at the entry point of the method + boolean allow_field_propagation = node.succs.isEmpty() || (node.succs.size() == 1 && node.succs.get(0).preds.size() == 1); + + if(!allow_field_propagation && varmaparr[0] != null) { + varmaparr[0].removeAllFields(); + varmaparr[1].removeAllFields(); + } + boolean this_updated = !mapsEqual(varmaparr[0], outVarVersions.get(node.id)) || (outNegVarVersions.containsKey(node.id) && !mapsEqual(varmaparr[1], outNegVarVersions.get(node.id)));