summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-02 10:05:01 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-02 10:05:01 +0000
commited2c44bbfe994aef8b23924882b4f965def59dc5 (patch)
tree3e1ea6cb7e1a277b79dc46bc57b6ef5b08f4a8d9 /numeric.c
parent77d3b78896d2e4e2da7db63ec0c81dcad0d30b0f (diff)
merge revision(s) 17749:17752:
* numeric.c (num_coerce): call rb_Float(x) first. don't depend on evaluation order of function arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index aaf98b62e8..b7b60982a7 100644
--- a/numeric.c
+++ b/numeric.c
@@ -121,7 +121,9 @@ num_coerce(x, y)
{
if (CLASS_OF(x) == CLASS_OF(y))
return rb_assoc_new(y, x);
- return rb_assoc_new(rb_Float(y), rb_Float(x));
+ x = rb_Float(x);
+ y = rb_Float(y);
+ return rb_assoc_new(y, x);
}
static VALUE