summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 12:45:51 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 12:45:51 +0000
commit6937a3e26f15199cb2c2cd180f2e83d941eaad8b (patch)
tree23752e3b95388e860c8be2950f5d768bac0c8b14
parentdf878f78c5c53137f1fad3c494362b6d821f8dc1 (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--random.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f9cbacf2707..9ef9d4b2cb9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/random.c b/random.c
index c3fce953111..bfdfaf6f3c3 100644
--- a/random.c
+++ b/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