changeset 10471:edf612527d74

small fix to code structured in IntegerStamp
author Lukas Stadler <lukas.stadler@jku.at>
date Sun, 23 Jun 2013 14:11:40 +0200
parents 53ba9df05fa2
children 195eb23d9909
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java	Fri Jun 21 11:58:39 2013 -0700
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java	Sun Jun 23 14:11:40 2013 +0200
@@ -131,13 +131,14 @@
         IntegerStamp other = (IntegerStamp) otherStamp;
         if (lowerBound > other.upperBound || upperBound < other.lowerBound) {
             return true;
-        } else {
-            if ((mask & other.mask) == 0) {
-                // zero is the only common value if the masks don't overlap => check for non-zero
-                return lowerBound > 0 || upperBound < 0 || other.lowerBound > 0 || other.upperBound < 0;
-            }
-            return false;
+        } else if ((mask & other.mask) == 0 && (lowerBound > 0 || upperBound < 0 || other.lowerBound > 0 || other.upperBound < 0)) {
+            /*
+             * Zero is the only common value if the masks don't overlap. If one of the two values is
+             * less than or greater than zero, they are always distinct.
+             */
+            return true;
         }
+        return false;
     }
 
     @Override