зеркало из https://github.com/github/ruby.git
* numeric.c (fix_aref): avoid a possible undefined behavior.
1L << 63 on 64-bit platform is undefined, at least, according to ISO/IEC 9899 (C99) 6.5.7. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
24cf72029f
Коммит
487a25d29b
|
@ -1,3 +1,9 @@
|
|||
Thu Oct 10 00:02:35 2013 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* numeric.c (fix_aref): avoid a possible undefined behavior.
|
||||
1L << 63 on 64-bit platform is undefined, at least, according to
|
||||
ISO/IEC 9899 (C99) 6.5.7.
|
||||
|
||||
Wed Oct 9 23:57:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* object.c (id_for_attr): avoid inadvertent symbol creation.
|
||||
|
|
|
@ -3443,7 +3443,7 @@ fix_aref(VALUE fix, VALUE idx)
|
|||
i = FIX2LONG(idx);
|
||||
|
||||
if (i < 0) return INT2FIX(0);
|
||||
if (SIZEOF_LONG*CHAR_BIT-1 < i) {
|
||||
if (SIZEOF_LONG*CHAR_BIT-1 <= i) {
|
||||
if (val < 0) return INT2FIX(1);
|
||||
return INT2FIX(0);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче