зеркало из https://github.com/github/ruby.git
* random.c (random_bytes): use NUM2LONG instead of FIX2LONG because
Random#bytes may receive bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
df878f78c5
Коммит
6937a3e26f
|
@ -1,3 +1,8 @@
|
|||
Thu Jul 30 21:43:41 2009 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* random.c (random_bytes): use NUM2LONG instead of FIX2LONG because
|
||||
Random#bytes may receive bignum.
|
||||
|
||||
Thu Jul 30 21:39:42 2009 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* compile.c (iseq_compile_each): fix stack consistency error.
|
||||
|
|
2
random.c
2
random.c
|
@ -797,7 +797,7 @@ rb_random_real(VALUE obj)
|
|||
static VALUE
|
||||
random_bytes(VALUE obj, VALUE len)
|
||||
{
|
||||
return rb_random_bytes(obj, FIX2LONG(rb_to_int(len)));
|
||||
return rb_random_bytes(obj, NUM2LONG(rb_to_int(len)));
|
||||
}
|
||||
|
||||
VALUE
|
||||
|
|
Загрузка…
Ссылка в новой задаче