diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-01 17:06:21 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-01 17:06:21 +0000 |
commit | 7a4401903177bd0e81e7e62c09cc6bc06f6a399d (patch) | |
tree | b3ae547aa307f2e2faf31bbad2f9c45112f8a1dc /string.c | |
parent | 318ecff41e2d768196afa96b5e99801f44d59f39 (diff) | |
download | ruby-7a4401903177bd0e81e7e62c09cc6bc06f6a399d.tar.gz |
* 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
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -2963,7 +2963,13 @@ static VALUE rb_str_hash_m(VALUE 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)) |