added allowsNaN check

fixed a bug with NaN


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@823 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 4f3f294b7c
commit 1d511e8ab8
  1. 11
      jode/jode/expr/CompareBinaryOperator.java

@ -22,6 +22,7 @@ import jode.type.Type;
import jode.decompiler.TabbedPrintWriter;
public class CompareBinaryOperator extends Operator {
boolean allowsNaN = false;
Type compareType;
public CompareBinaryOperator(Type type, int op) {
@ -30,6 +31,13 @@ public class CompareBinaryOperator extends Operator {
initOperands(2);
}
public CompareBinaryOperator(Type type, int op, boolean allowsNaN) {
super(Type.tBoolean, op);
compareType = type;
this.allowsNaN = allowsNaN;
initOperands(2);
}
public int getPriority() {
switch (getOperatorIndex()) {
case 26:
@ -62,8 +70,7 @@ public class CompareBinaryOperator extends Operator {
}
public Expression negate() {
if ((getType() != Type.tFloat && getType() != Type.tDouble)
|| getOperatorIndex() <= NOTEQUALS_OP) {
if (!allowsNaN || getOperatorIndex() <= NOTEQUALS_OP) {
setOperatorIndex(getOperatorIndex() ^ 1);
return this;
}

Loading…
Cancel
Save