Use a local for CheckNullOperator

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@232 379699f6-c40d-0410-875b-85095c16579e
stable
delwi 26 years ago
parent 089e466e81
commit 52a1f6fe06
  1. 9
      jode/jode/flow/CreateCheckNull.java

@ -20,6 +20,7 @@
package jode.flow; package jode.flow;
import jode.decompiler.*; import jode.decompiler.*;
import jode.Type; import jode.Type;
import jode.LocalInfo;
public class CreateCheckNull { public class CreateCheckNull {
@ -60,7 +61,9 @@ public class CreateCheckNull {
.equals("()Ljava/lang/Class;"))) .equals("()Ljava/lang/Class;")))
return false; return false;
ic.setInstruction(new CheckNullOperator(Type.tUObject)); LocalInfo li = new LocalInfo();
ic.setInstruction(new CheckNullOperator(Type.tUObject, li));
ic.used.addElement(li);
last.replace(last.outer); last.replace(last.outer);
return true; return true;
} }
@ -85,8 +88,10 @@ public class CreateCheckNull {
|| !(expr.getOperator().getOperandType(0).isOfType(Type.tUObject))) || !(expr.getOperator().getOperandType(0).isOfType(Type.tUObject)))
return false; return false;
LocalInfo li = new LocalInfo();
InstructionContainer ic = InstructionContainer ic =
new InstructionBlock(new CheckNullOperator(Type.tUObject)); new InstructionBlock(new CheckNullOperator(Type.tUObject, li));
ic.used.addElement(li);
ifBlock.flowBlock.removeSuccessor(ifBlock.thenBlock.jump); ifBlock.flowBlock.removeSuccessor(ifBlock.thenBlock.jump);
ic.moveJump(ifBlock.jump); ic.moveJump(ifBlock.jump);
if (last == ifBlock) { if (last == ifBlock) {

Loading…
Cancel
Save