bug fix for jikes check null

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@854 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent e46d303867
commit 863bb28203
  1. 8
      jode/jode/flow/CreateCheckNull.java

@ -32,7 +32,7 @@ public class CreateCheckNull {
* *
* jikes: * jikes:
* DUP * DUP
* if (!POP != null) * if (POP == null)
* throw null; * throw null;
*/ */
@ -80,8 +80,10 @@ public class CreateCheckNull {
* Transforms the code * Transforms the code
* <pre> * <pre>
* DUP * DUP
* if (POP == null) * if (POP == null) {
* throw null * throw null
* GOTO END_OF_METHOD // not checked
* }
* </pre> * </pre>
* to a CheckNullOperator. This is what jikes generates when it * to a CheckNullOperator. This is what jikes generates when it
* calls ".new" on an operand. * calls ".new" on an operand.
@ -102,7 +104,7 @@ public class CreateCheckNull {
if (!(ifBlock.cond instanceof CompareUnaryOperator)) if (!(ifBlock.cond instanceof CompareUnaryOperator))
return false; return false;
CompareUnaryOperator cmpOp = (CompareUnaryOperator) ifBlock.cond; CompareUnaryOperator cmpOp = (CompareUnaryOperator) ifBlock.cond;
if (cmpOp.getOperatorIndex() != Operator.NOTEQUALS_OP if (cmpOp.getOperatorIndex() != Operator.EQUALS_OP
|| !(cmpOp.getCompareType().isOfType(Type.tUObject))) || !(cmpOp.getCompareType().isOfType(Type.tUObject)))
return false; return false;

Loading…
Cancel
Save