mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* insns.def (opt_succ): use LONG_MAX as maximum Fixnum VALUE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c13cd729bf
commit
d504f64a3b
2 changed files with 5 additions and 2 deletions
|
@ -1,3 +1,7 @@
|
|||
Thu Jul 12 21:38:02 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* insns.def (opt_succ): use LONG_MAX as maximum Fixnum VALUE.
|
||||
|
||||
Thu Jul 12 18:42:18 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* range.c (range_max): use FIX2LONG instead of FIX2INT to avoid
|
||||
|
|
|
@ -2304,8 +2304,7 @@ opt_succ
|
|||
const VALUE obj = INT2FIX(1);
|
||||
/* fixnum + INT2FIX(1) */
|
||||
val = (recv + (obj & (~1)));
|
||||
if ((~(recv ^ obj) & (recv ^ val)) &
|
||||
((VALUE)0x01 << ((sizeof(VALUE) * CHAR_BIT) - 1))) {
|
||||
if ((~(recv ^ obj) & (recv ^ val)) & (LONG_MAX + 1)) {
|
||||
val = rb_big_plus(rb_int2big(FIX2LONG(recv)),
|
||||
rb_int2big(FIX2LONG(obj)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue