1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
matz 2006-02-22 05:26:33 +00:00
parent 3647fb485c
commit 145b7e1b8b
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Wed Feb 22 14:21:03 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* bignum.c (bignorm): x may not be a bignum. [ruby-dev:28367]
Wed Feb 22 09:22:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org> Wed Feb 22 09:22:40 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (proc_alloc): add proper check for creation of a lambda * eval.c (proc_alloc): add proper check for creation of a lambda

View file

@ -92,7 +92,10 @@ rb_big_2comp(VALUE x) /* get 2's complement */
static VALUE static VALUE
bignorm(VALUE x) bignorm(VALUE x)
{ {
if (!FIXNUM_P(x)) { if (FIXNUM_P(x)) {
return x;
}
else if (TYPE(x) == T_BIGNUM) {
long len = RBIGNUM(x)->len; long len = RBIGNUM(x)->len;
BDIGIT *ds = BDIGITS(x); BDIGIT *ds = BDIGITS(x);