Reported by achim.passen, Jan 10, 2009
There are some corner cases where "-" overflows but does not throw an "integer overflow"
exception:
user=> (- Integer/MAX_VALUE Integer/MIN_VALUE)
-1
user=> (- Long/MAX_VALUE Long/MIN_VALUE)
-1
The problem seems to be that negating MIN_VALUE yields MIN_VALUE
again, so it slips through the overflow check. The patch adds extra checks for MIN_VALUE.
version: SVN r1205
http:
overflow.diff
693 bytes Download
Comment 1 by richhickey, Jan 14, 2009
patch applied - svn 1212 - thanks!
Status: Fixed
Converted from http://www.assembla.com/spaces/clojure/tickets/44
Attachments:
overflow.diff - https://www.assembla.com/spaces/clojure/documents/bz9pX-w3mr3PSteJe5afGb/download/bz9pX-w3mr3PSteJe5afGb