summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-15 12:55:23 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-15 12:55:23 +0000
commitb79e96ae62bf61530c955053c61125f652c2a8fe (patch)
treeec169812f3ad122da52c6785c48d1447257aa873 /numeric.c
parentdc7ba7e49a62ada70e20a971542841ca9057a0b9 (diff)
* numeric.c (fix_divide): must not use rb_rational_new1 for coercion
because it returns an argument itself when canonical mode is set. [ruby-core:31279] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 8b5423b884..eb3d4be9ff 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2429,7 +2429,7 @@ fix_divide(VALUE x, VALUE y, ID op)
case T_RATIONAL:
if (op == '/' && FIX2LONG(x) == 1)
return rb_rational_reciprocal(y);
- return rb_funcall(rb_rational_new1(x), op, 1, y);
+ /* fall through */
default:
return rb_num_coerce_bin(x, y, op);
}