some more fixes for special cases

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@439 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 44e5268536
commit c8d13a5f43
  1. 15
      jode/jode/flow/CreateNewConstructor.java

@ -61,9 +61,7 @@ public class CreateNewConstructor {
((ComplexExpression) constrExpr).getSubExpressions(); ((ComplexExpression) constrExpr).getSubExpressions();
if (!(subs[0] instanceof NopOperator)) if (!(subs[0] instanceof NopOperator))
return false; return false;
if (constrExpr.getOperandCount() == 2) { if (constrExpr.getOperandCount() > 1) {
if (!(subs[1] instanceof NopOperator))
return false;
if (!(sequBlock.outer instanceof SequentialBlock) if (!(sequBlock.outer instanceof SequentialBlock)
|| !(sequBlock.subBlocks[0] instanceof SpecialBlock)) || !(sequBlock.subBlocks[0] instanceof SpecialBlock))
return false; return false;
@ -73,6 +71,7 @@ public class CreateNewConstructor {
|| optDupX2.depth == 0) || optDupX2.depth == 0)
return false; return false;
int count = optDupX2.count; int count = optDupX2.count;
int opcount = constrExpr.getOperandCount() - 1;
do { do {
if (!(sequBlock.outer instanceof SequentialBlock) if (!(sequBlock.outer instanceof SequentialBlock)
|| !(sequBlock.subBlocks[0] || !(sequBlock.subBlocks[0]
@ -81,9 +80,15 @@ public class CreateNewConstructor {
Expression expr = Expression expr =
((InstructionBlock) ((InstructionBlock)
sequBlock.subBlocks[0]).getInstruction(); sequBlock.subBlocks[0]).getInstruction();
count -= expr.getType().stackSize();
sequBlock = (SequentialBlock) sequBlock.outer; sequBlock = (SequentialBlock) sequBlock.outer;
} while (count > 0);
if (expr.isVoid())
continue;
count -= expr.getType().stackSize();
opcount--;
} while (count > 0 && opcount > 0);
if (opcount != 0 || count != 0)
return false;
} else if (constrExpr.getOperandCount() != 1) } else if (constrExpr.getOperandCount() != 1)
return false; return false;
} else if (constrExpr.getOperandCount() != 1) } else if (constrExpr.getOperandCount() != 1)

Loading…
Cancel
Save