summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 07:24:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 07:24:33 +0000
commit1f71ea2fd23e640efb3300ba9a9432ff99801a15 (patch)
tree8bddddf973e94b6abbe5b40a93ebf8f41e4991e9
parent4b4d364e5228a42eef3f086c01a7067680fd1f6a (diff)
random.c: use rb_check_funcall
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--random.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/random.c b/random.c
index 4efe174da9..0294533c05 100644
--- a/random.c
+++ b/random.c
@@ -1165,8 +1165,7 @@ range_values(VALUE vmax, VALUE *begp, VALUE *endp, int *exclp)
if (!rb_range_values(vmax, begp, &end, exclp)) return Qfalse;
if (endp) *endp = end;
if (NIL_P(end)) return Qnil;
- if (!rb_respond_to(end, id_minus)) return Qfalse;
- r = rb_funcallv(end, id_minus, 1, begp);
+ r = rb_check_funcall(end, id_minus, 1, begp);
if (NIL_P(r)) return Qfalse;
return r;
}