1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* numeric.c (check_uint): get rid of overflow on LLP64 platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-10-13 13:53:22 +00:00
parent dc647aea2e
commit 9d0c732f0d
2 changed files with 4 additions and 2 deletions

View file

@ -1,4 +1,6 @@
Wed Oct 13 22:51:17 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
Wed Oct 13 22:53:19 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* numeric.c (check_uint): get rid of overflow on LLP64 platforms.
* insns.def (opt_case_dispatch): use st_data_t.

View file

@ -1824,7 +1824,7 @@ check_uint(VALUE num, VALUE sign)
if (RTEST(sign)) {
/* minus */
if ((num & mask) != mask || (num & ~mask) <= INT_MAX + 1UL)
#define VALUE_MSBMASK (1L << ((sizeof(VALUE) * CHAR_BIT) - 1))
#define VALUE_MSBMASK ((VALUE)1 << ((sizeof(VALUE) * CHAR_BIT) - 1))
rb_raise(rb_eRangeError, "integer %"PRIdVALUE " too small to convert to `unsigned int'", num|VALUE_MSBMASK);
}
else {