diff --git a/jode/jode/flow/CombineIfGotoExpressions.java b/jode/jode/flow/CombineIfGotoExpressions.java index 787a015..42fcb40 100644 --- a/jode/jode/flow/CombineIfGotoExpressions.java +++ b/jode/jode/flow/CombineIfGotoExpressions.java @@ -44,7 +44,8 @@ public class CombineIfGotoExpressions { return false; Expression expr = ib.getInstruction(); - if (lastCombined.canCombine(expr) + e[1].canCombine(expr) <= 0) + if (!(expr.getOperator() instanceof CombineableOperator) + || lastCombined.canCombine(expr) + e[1].canCombine(expr) <= 0) /* Tricky, the above is true, iff one of the two * Expressions conflict, or both fail. */ return false; diff --git a/jode/jode/flow/CreateExpression.java b/jode/jode/flow/CreateExpression.java index 727836d..2f14f1e 100644 --- a/jode/jode/flow/CreateExpression.java +++ b/jode/jode/flow/CreateExpression.java @@ -72,11 +72,12 @@ public class CreateExpression { Expression expr = ((InstructionBlock) sequBlock.subBlocks[0]).getInstruction(); - if (!expr.isVoid()) { if (--i == 0) break; } else if (lastExpression == null + || !(expr.getOperator() + instanceof CombineableOperator) || lastExpression.canCombine(expr) <= 0) return false; diff --git a/jode/jode/flow/CreateForInitializer.java b/jode/jode/flow/CreateForInitializer.java index 6e6ed6d..3be28e1 100644 --- a/jode/jode/flow/CreateForInitializer.java +++ b/jode/jode/flow/CreateForInitializer.java @@ -41,6 +41,8 @@ public class CreateForInitializer { InstructionBlock init = (InstructionBlock) sequBlock.subBlocks[0]; if (!init.getInstruction().isVoid() + || !(init.getInstruction().getOperator() + instanceof CombineableOperator) || !forBlock.conditionMatches(init)) return false; diff --git a/jode/jode/flow/FlowBlock.java b/jode/jode/flow/FlowBlock.java index 97d8d46..f743dad 100644 --- a/jode/jode/flow/FlowBlock.java +++ b/jode/jode/flow/FlowBlock.java @@ -21,6 +21,7 @@ package jode.flow; import java.util.*; import jode.*; import jode.decompiler.Expression; +import jode.decompiler.CombineableOperator; /** * A flow block is the structure of which the flow graph consists. A @@ -783,9 +784,10 @@ public class FlowBlock { } if (!createdForBlock - && ((InstructionBlock) - lastModified).getInstruction().isVoid()) { - + && (((InstructionBlock) + lastModified).getInstruction().getOperator() + instanceof CombineableOperator)) { + /* The only jump is the jump of the last * instruction lastModified, there is a big * chance, that this is a for block, but we