ruby-changes:51956
From: nobu <ko1@a...>
Date: Fri, 3 Aug 2018 20:13:20 +0900 (JST)
Subject: [ruby-changes:51956] nobu:r64171 (trunk): random.c: fix fallback value
nobu 2018-08-03 20:13:15 +0900 (Fri, 03 Aug 2018) New Revision: 64171 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64171 Log: random.c: fix fallback value Modified files: trunk/random.c Index: random.c =================================================================== --- random.c (revision 64170) +++ random.c (revision 64171) @@ -1160,14 +1160,12 @@ random_s_bytes(VALUE obj, VALUE len) https://github.com/ruby/ruby/blob/trunk/random.c#L1160 static VALUE range_values(VALUE vmax, VALUE *begp, VALUE *endp, int *exclp) { - VALUE end, r; + VALUE end; if (!rb_range_values(vmax, begp, &end, exclp)) return Qfalse; if (endp) *endp = end; if (NIL_P(end)) return Qnil; - r = rb_check_funcall(end, id_minus, 1, begp); - if (NIL_P(r)) return Qfalse; - return r; + return rb_check_funcall_default(end, id_minus, 1, begp, Qfalse); } static VALUE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/