diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-15 19:42:59 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-15 19:42:59 +0000 |
commit | 2708fb6ba7636adf1d8263dd2654f257f8b76324 (patch) | |
tree | 44fb61b8aa8da6c28d81bf55c42fdb3c0db46fd6 /insns.def | |
parent | 0e5f9aeaeafe2fa9189956010ba45fdd41d6076d (diff) | |
download | ruby-2708fb6ba7636adf1d8263dd2654f257f8b76324.tar.gz |
* insns.def (opt_plus): simply use LONG2NUM() instead of wrongly
complex overflow case.
* insns.def (opt_sub): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -1332,12 +1332,7 @@ opt_plus a = FIX2LONG(recv); b = FIX2LONG(obj); c = a + b; - if (FIXABLE(c)) { - val = LONG2FIX(c); - } - else { - val = rb_big_plus(rb_int2big(a), rb_int2big(b)); - } + val = LONG2NUM(c); #endif } else if (FLONUM_2_P(recv, obj) && @@ -1387,13 +1382,7 @@ opt_minus a = FIX2LONG(recv); b = FIX2LONG(obj); c = a - b; - - if (FIXABLE(c)) { - val = LONG2FIX(c); - } - else { - val = rb_big_minus(rb_int2big(a), rb_int2big(b)); - } + val = LONG2NUM(c); } else if (FLONUM_2_P(recv, obj) && BASIC_OP_UNREDEFINED_P(BOP_MINUS, FLOAT_REDEFINED_OP_FLAG)) { |