summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-05 00:03:45 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-05 00:03:45 (GMT)
commit74ba0cfc622925c2527b3d281802a3d1ab86363d (patch)
treeebcdcef3fdff8569f3882c64d6b0d4f7763c9809 /random.c
parent4509b36666730c9676b0768ec0c8f9746e8aeb4b (diff)
random.c: private rand
* random.c (rb_random_ulong_limited): do not call private method rand. [ruby-dev:49892] [Misc #13003] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/random.c b/random.c
index ee91c53..a5c5292 100644
--- a/random.c
+++ b/random.c
@@ -1018,7 +1018,7 @@ rb_random_ulong_limited(VALUE obj, unsigned long limit)
rb_random_t *rnd = try_get_rnd(obj);
if (!rnd) {
VALUE lim = ulong_to_num_plus_1(limit);
- VALUE v = rb_to_int(rb_funcallv(obj, id_rand, 1, &lim));
+ VALUE v = rb_to_int(rb_funcallv_public(obj, id_rand, 1, &lim));
unsigned long r = NUM2ULONG(v);
if (rb_num_negative_p(v)) {
rb_raise(rb_eRangeError, "random number too small %ld", r);