* string.c (rb_str_hash_m): st_index_t is not guaranteed as the same
size with int, and of course also not guaranteed the value can be Fixnum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
318ecff41e
commit
7a44019031
@ -1,3 +1,9 @@
|
|||||||
|
Sun Oct 2 02:04:12 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_str_hash_m): st_index_t is not guaranteed as the same
|
||||||
|
size with int, and of course also not guaranteed the value can be
|
||||||
|
Fixnum.
|
||||||
|
|
||||||
Sun Oct 2 02:03:06 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
Sun Oct 2 02:03:06 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* numeric.c (rb_fix2str): detect unnormalized Fixnum value.
|
* numeric.c (rb_fix2str): detect unnormalized Fixnum value.
|
||||||
|
8
string.c
8
string.c
@ -2963,7 +2963,13 @@ static VALUE
|
|||||||
rb_str_hash_m(VALUE str)
|
rb_str_hash_m(VALUE str)
|
||||||
{
|
{
|
||||||
st_index_t hval = rb_str_hash(str);
|
st_index_t hval = rb_str_hash(str);
|
||||||
return INT2FIX(hval);
|
#if SIZEOF_LONG == SIZEOF_VOIDP
|
||||||
|
return ULONG2NUM(hval);
|
||||||
|
#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP
|
||||||
|
return ULL2NUM(hval);
|
||||||
|
#else
|
||||||
|
# error unsupported platform
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#define lesser(a,b) (((a)>(b))?(b):(a))
|
#define lesser(a,b) (((a)>(b))?(b):(a))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user