summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--numeric.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 30df76968b..f3ea7fc092 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jul 15 21:43:35 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * 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]
+
Thu Jul 15 21:38:31 2010 Yusuke Endoh <mame@tsg.ne.jp>
* proc.c (bm_free): fix memory leak. [ruby-core:30869] [Bug #3466]
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);
}