summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-20 07:42:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-20 07:42:20 +0000
commit5c5a7f8f06cbf3b0128a7b7aab9365a4d762cdc4 (patch)
treee3728c705f7ffeca7624ab6f6b31284be673b53f /bignum.c
parent75be771ccea289aada79f0380d1dd1d6df6e2d00 (diff)
* bignum.c (rb_big2long): should not raise RangeError for Bignum
LONG_MIN value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index e342989da8..9882c69401 100644
--- a/bignum.c
+++ b/bignum.c
@@ -467,7 +467,7 @@ rb_big2long(x)
{
unsigned long num = big2ulong(x, "int");
- if ((long)num < 0) {
+ if ((long)num < 0 && (long)num != LONG_MIN) {
rb_raise(rb_eRangeError, "bignum too big to convert into `int'");
}
if (!RBIGNUM(x)->sign) return -(long)num;