From c8d13a5f432293de7e0ab8b4deb105409fa78ba7 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 15 Mar 1999 21:28:48 +0000 Subject: [PATCH] some more fixes for special cases git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@439 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/flow/CreateNewConstructor.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/jode/jode/flow/CreateNewConstructor.java b/jode/jode/flow/CreateNewConstructor.java index 29af9fe..f1c6f8f 100644 --- a/jode/jode/flow/CreateNewConstructor.java +++ b/jode/jode/flow/CreateNewConstructor.java @@ -61,9 +61,7 @@ public class CreateNewConstructor { ((ComplexExpression) constrExpr).getSubExpressions(); if (!(subs[0] instanceof NopOperator)) return false; - if (constrExpr.getOperandCount() == 2) { - if (!(subs[1] instanceof NopOperator)) - return false; + if (constrExpr.getOperandCount() > 1) { if (!(sequBlock.outer instanceof SequentialBlock) || !(sequBlock.subBlocks[0] instanceof SpecialBlock)) return false; @@ -73,6 +71,7 @@ public class CreateNewConstructor { || optDupX2.depth == 0) return false; int count = optDupX2.count; + int opcount = constrExpr.getOperandCount() - 1; do { if (!(sequBlock.outer instanceof SequentialBlock) || !(sequBlock.subBlocks[0] @@ -81,9 +80,15 @@ public class CreateNewConstructor { Expression expr = ((InstructionBlock) sequBlock.subBlocks[0]).getInstruction(); - count -= expr.getType().stackSize(); 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) return false; } else if (constrExpr.getOperandCount() != 1)