diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | insns.def | 3 |
2 files changed, 5 insertions, 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))); } |