# HG changeset patch # User Gilles Duboscq # Date 1346238343 -7200 # Node ID 4535a87e8bf895d37fee37de1a9078e017391dd3 # Parent 6a51bc21630666eb821b8e6ea060a85c158ece5d Fix for sameSign check and javadoc diff -r 6a51bc216306 -r 4535a87e8bf8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java Tue Aug 28 14:58:55 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java Wed Aug 29 13:05:43 2012 +0200 @@ -200,8 +200,13 @@ } } + /** + * Checks if the 2 stamps represent values of the same sign. + * Returns true if the two stamps are both positive of null or if they are both strictly negative + * @return true if the two stamps are both positive of null or if they are both strictly negative + */ public static boolean sameSign(IntegerStamp s1, IntegerStamp s2) { - return s1.isPositive() && s2.isPositive() || s1.isNegative() && s2.isNegative(); + return s1.isPositive() && s2.isPositive() || s1.isStrictlyNegative() && s2.isStrictlyNegative(); } }