From bd3eb8afec7f814f25827d4c5359a0b3d20a28bf Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 22 Oct 2016 13:33:34 +0000 Subject: numeric.c: fix up r55891 * numeric.c (num_funcall1): check recursion by inverse pair, to fix fake infinite recursion. [ruby-core:77713] [Bug #12864] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index e288119318..7d4d9225e9 100644 --- a/numeric.c +++ b/numeric.c @@ -294,10 +294,10 @@ num_funcall0(VALUE x, ID func) } static VALUE -num_funcall_op_1(VALUE x, VALUE arg, int recursive) +num_funcall_op_1(VALUE y, VALUE arg, int recursive) { ID func = (ID)((VALUE *)arg)[0]; - VALUE y = ((VALUE *)arg)[1]; + VALUE x = ((VALUE *)arg)[1]; if (recursive) { const char *name = rb_id2name(func); if (ISALNUM(name[0])) { @@ -317,8 +317,8 @@ num_funcall1(VALUE x, ID func, VALUE y) { VALUE args[2]; args[0] = (VALUE)func; - args[1] = y; - return rb_exec_recursive_paired(num_funcall_op_1, x, y, (VALUE)args); + args[1] = x; + return rb_exec_recursive_paired(num_funcall_op_1, y, x, (VALUE)args); } /* -- cgit v1.2.3