diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-22 13:33:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-22 13:33:34 +0000 |
commit | da503a9e2345b3772774297d9ac9106146f2c65a (patch) | |
tree | 57e49ec5a1164e87d615a1eaa1657cdedd0a210c /numeric.c | |
parent | 0e2ab7ea3c308078e71263b0ba83259e1a238fa7 (diff) | |
download | ruby-da503a9e2345b3772774297d9ac9106146f2c65a.tar.gz |
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
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); } /* |