summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-01-14 23:35:00 +0000
committerRich Hickey <richhickey@gmail.com>2009-01-14 23:35:00 +0000
commitbde3591fd2e6069a6a88f0bfeb0d2941cec34387 (patch)
treeb45c8fd297010f451ba6986acf28710b51caab71 /src
parentba09ea0b890e086279d7bb89719e626de30357b8 (diff)
fix (- Integer/MAX_VALUE Integer/MIN_VALUE), patch from Achim Passen
Diffstat (limited to 'src')
-rw-r--r--src/jvm/clojure/lang/Numbers.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jvm/clojure/lang/Numbers.java b/src/jvm/clojure/lang/Numbers.java
index e40fe39a..4a49c8cb 100644
--- a/src/jvm/clojure/lang/Numbers.java
+++ b/src/jvm/clojure/lang/Numbers.java
@@ -1740,7 +1740,7 @@ static public int xor(int x, int y){
static public int minus(int x, int y){
int ret = x - y;
- if ((ret ^ x) < 0 && (ret ^ -y) < 0)
+ if (((ret ^ x) < 0 && (ret ^ -y) < 0) || (y == Integer.MIN_VALUE))
return throwIntOverflow();
return ret;
}
@@ -1847,7 +1847,7 @@ static public long add(long x, long y){
static public long minus(long x, long y){
long ret = x - y;
- if ((ret ^ x) < 0 && (ret ^ -y) < 0)
+ if (((ret ^ x) < 0 && (ret ^ -y) < 0) || (y == Long.MIN_VALUE))
return throwIntOverflow();
return ret;
}