summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-22 13:33:34 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-22 13:33:34 +0000
commitbd3eb8afec7f814f25827d4c5359a0b3d20a28bf (patch)
tree57e49ec5a1164e87d615a1eaa1657cdedd0a210c /numeric.c
parent4154b96068eab8fc5e9359ad26747e9dabdceea1 (diff)
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.c8
1 files changed, 4 insertions, 4 deletions
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);
}
/*