|
|
@ -72,23 +72,19 @@ public class CreateCheckNull { |
|
|
|
|| ifBlock.elseBlock != null |
|
|
|
|| ifBlock.elseBlock != null |
|
|
|
|| !(ifBlock.thenBlock instanceof ThrowBlock)) |
|
|
|
|| !(ifBlock.thenBlock instanceof ThrowBlock)) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
System.err.println("last.outer: "+last.outer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SpecialBlock dup = (SpecialBlock) last.outer.getSubBlocks()[0]; |
|
|
|
SpecialBlock dup = (SpecialBlock) last.outer.getSubBlocks()[0]; |
|
|
|
if (dup.type != SpecialBlock.DUP |
|
|
|
if (dup.type != SpecialBlock.DUP |
|
|
|
|| dup.count != 1 || dup.depth != 0) |
|
|
|
|| dup.count != 1 || dup.depth != 0) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
System.err.println("tick1"); |
|
|
|
|
|
|
|
/* negate the instruction back to its original state */ |
|
|
|
/* negate the instruction back to its original state */ |
|
|
|
Expression expr = ifBlock.cond.negate(); |
|
|
|
Expression expr = ifBlock.cond.negate(); |
|
|
|
System.err.println(expr); |
|
|
|
|
|
|
|
if (!(expr instanceof CompareUnaryOperator) |
|
|
|
if (!(expr instanceof CompareUnaryOperator) |
|
|
|
|| expr.getOperator().getOperatorIndex() != Operator.NOTEQUALS_OP |
|
|
|
|| expr.getOperator().getOperatorIndex() != Operator.NOTEQUALS_OP |
|
|
|
|| !(expr.getOperator().getOperandType(0).isOfType(Type.tUObject))) |
|
|
|
|| !(expr.getOperator().getOperandType(0).isOfType(Type.tUObject))) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
System.err.println("tick2"); |
|
|
|
|
|
|
|
InstructionContainer ic = |
|
|
|
InstructionContainer ic = |
|
|
|
new InstructionBlock(new CheckNullOperator(Type.tUObject)); |
|
|
|
new InstructionBlock(new CheckNullOperator(Type.tUObject)); |
|
|
|
ifBlock.flowBlock.removeSuccessor(ifBlock.thenBlock.jump); |
|
|
|
ifBlock.flowBlock.removeSuccessor(ifBlock.thenBlock.jump); |
|
|
|