summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-04-17 08:26:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-04-17 08:26:13 +0000
commit1c293eea0871979f65717597f7209360c0e0be7b (patch)
tree977a5c5463610a629a89acac073f1d2d5495c2cd /bignum.c
parentd4527f8b86c441603cba416bf1df43403cbbbe3c (diff)
* eval.c (safe_getter): should use INT2NUM().
* bignum.c (rb_big2long): 2**31 cannot fit in 31 bit long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1323 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 9796f1d214..708d74c155 100644
--- a/bignum.c
+++ b/bignum.c
@@ -471,7 +471,7 @@ rb_big2long(x)
{
unsigned long num = big2ulong(x, "int");
- if ((long)num < 0 && (long)num != LONG_MIN) {
+ if ((long)num < 0 && (RBIGNUM(x)->sign || (long)num != LONG_MIN)) {
rb_raise(rb_eRangeError, "bignum too big to convert into `int'");
}
if (!RBIGNUM(x)->sign) return -(long)num;