diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-02 10:02:35 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-02 10:02:35 +0000 |
commit | 6f9c8ea348e8b5f255e183b3d4c95c64ecdda60b (patch) | |
tree | 042299d482a76df8598e45165fe1431afe090a49 /numeric.c | |
parent | a25e2452f63e3716ae3c9943872efe583f4b91fb (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_6@17811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |