Fixed for new early addOperand

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

@ -38,41 +38,37 @@ public class CreateConstantArray {
SequentialBlock sequBlock = (SequentialBlock) last.outer; SequentialBlock sequBlock = (SequentialBlock) last.outer;
if (!(ic.getInstruction() instanceof ArrayStoreOperator) Operator storeOp = ic.getInstruction().getOperator();
|| !(sequBlock.subBlocks[0] instanceof InstructionBlock) if (!(ic.getInstruction() instanceof ComplexExpression)
|| !(ic.getInstruction().getOperator()
instanceof ArrayStoreOperator)
|| ic.getInstruction().getOperandCount() != 1
|| !(sequBlock.subBlocks[0] instanceof SpecialBlock)
|| !(sequBlock.outer instanceof SequentialBlock)) || !(sequBlock.outer instanceof SequentialBlock))
return false; return false;
ArrayStoreOperator store
= (ArrayStoreOperator) ic.getInstruction();
InstructionBlock ib = (InstructionBlock)sequBlock.subBlocks[0];
sequBlock = (SequentialBlock) sequBlock.outer;
if (!(sequBlock.subBlocks[0] instanceof InstructionBlock) ComplexExpression storeExpr
|| !(sequBlock.outer instanceof SequentialBlock)) = (ComplexExpression) ic.getInstruction();
return false; ArrayStoreOperator store
= (ArrayStoreOperator) storeExpr.getOperator();
Expression expr = ib.getInstruction(); Expression[] storeSub = storeExpr.getSubExpressions();
ib = (InstructionBlock)sequBlock.subBlocks[0]; if (!(storeSub[0] instanceof NopOperator)
sequBlock = (SequentialBlock) sequBlock.outer; || !(storeSub[1] instanceof ConstOperator))
return false;
if (expr.getOperandCount() > 0 Expression expr = storeSub[2];
|| !(ib.getInstruction() instanceof ConstOperator) ConstOperator indexOp = (ConstOperator) storeSub[1];
|| !(sequBlock.subBlocks[0] instanceof SpecialBlock)
|| !(sequBlock.outer instanceof SequentialBlock))
return false;
ConstOperator indexOp = (ConstOperator) ib.getInstruction();
SpecialBlock dup = (SpecialBlock) sequBlock.subBlocks[0]; SpecialBlock dup = (SpecialBlock) sequBlock.subBlocks[0];
sequBlock = (SequentialBlock) sequBlock.outer; sequBlock = (SequentialBlock) sequBlock.outer;
if (!indexOp.getType().isOfType(Type.tUInt) if (dup.type != SpecialBlock.DUP
|| dup.type != SpecialBlock.DUP
|| dup.depth != 0 || dup.count != 1 || dup.depth != 0 || dup.count != 1
|| !(sequBlock.subBlocks[0] instanceof InstructionBlock)) || !(sequBlock.subBlocks[0] instanceof InstructionBlock))
return false; return false;
int index = Integer.parseInt(indexOp.getValue()); int index = Integer.parseInt(indexOp.getValue());
ib = (InstructionBlock)sequBlock.subBlocks[0]; InstructionBlock ib = (InstructionBlock)sequBlock.subBlocks[0];
if (ib.getInstruction() instanceof ComplexExpression if (ib.getInstruction() instanceof ComplexExpression
&& (ib.getInstruction().getOperator() && (ib.getInstruction().getOperator()

Loading…
Cancel
Save