Reported by achim.passen, Jan 10, 2009
There are some corner cases where "-" overflows but does not throw an "integer overflow"
user=> (- Integer/MAX_VALUE Integer/MIN_VALUE)
user=> (- Long/MAX_VALUE Long/MIN_VALUE)
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
693 bytes Download
Comment 1 by richhickey, Jan 14, 2009
patch applied - svn 1212 - thanks!