summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-22 05:26:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-02-22 05:26:33 +0000
commit145b7e1b8b1424f8199b772199a2cbf3e2862093 (patch)
tree52c5fe8f41c31441633a02c9a783bd1fb03f2d95 /bignum.c
parent3647fb485cfd027d9dfe54cf9795a4cbe90ed0dd (diff)
* bignum.c (bignorm): x may not be a bignum. [ruby-dev:28367]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index 587564929b..9cf7a3702f 100644
--- a/bignum.c
+++ b/bignum.c
@@ -92,7 +92,10 @@ rb_big_2comp(VALUE x) /* get 2's complement */
static VALUE
bignorm(VALUE x)
{
- if (!FIXNUM_P(x)) {
+ if (FIXNUM_P(x)) {
+ return x;
+ }
+ else if (TYPE(x) == T_BIGNUM) {
long len = RBIGNUM(x)->len;
BDIGIT *ds = BDIGITS(x);