mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* insns.def: Fix optimization bug of Float#/ [Bug #9238]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9a938987cb
commit
af4e6084d0
3 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Dec 11 03:18:08 2013 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||
|
||||
* insns.def: Fix optimization bug of Float#/ [Bug #9238]
|
||||
|
||||
Tue Dec 10 23:58:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/date/date_strptime.c (date__strptime_internal): unset
|
||||
|
|
|
@ -1511,7 +1511,7 @@ opt_div
|
|||
val = LONG2NUM(div);
|
||||
}
|
||||
else if (FLONUM_2_P(recv, obj) &&
|
||||
BASIC_OP_UNREDEFINED_P(BOP_MULT, FLOAT_REDEFINED_OP_FLAG)) {
|
||||
BASIC_OP_UNREDEFINED_P(BOP_DIV, FLOAT_REDEFINED_OP_FLAG)) {
|
||||
val = DBL2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
|
||||
}
|
||||
else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
|
||||
|
|
|
@ -67,6 +67,7 @@ class TestRubyOptimization < Test::Unit::TestCase
|
|||
|
||||
def test_fixnum_div
|
||||
assert_equal 3, 15 / 5
|
||||
assert_equal 6.66, redefine_method('Float', '/') { 4.2 / 6.66 }, "bug 9238"
|
||||
end
|
||||
|
||||
def test_fixnum_mod
|
||||
|
|
Loading…
Reference in a new issue