diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-01 22:51:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-01 22:51:23 +0000 |
commit | 50316b8808cef616fa6291a39573d9bd829345c8 (patch) | |
tree | cf5c004f9f604229b4d12e1d3902b242fd5d63d7 /string.c | |
parent | 8747e4715efb0ba80e52f558ee93ac0857a7f41d (diff) | |
download | ruby-50316b8808cef616fa6291a39573d9bd829345c8.tar.gz |
string.c: negative hash
* string.c (rb_str_hash_m): hash values may be negative.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2964,9 +2964,9 @@ rb_str_hash_m(VALUE str) { st_index_t hval = rb_str_hash(str); #if SIZEOF_LONG == SIZEOF_VOIDP - return ULONG2NUM(hval); + return LONG2FIX((long)hval); #elif SIZEOF_LONG_LONG == SIZEOF_VOIDP - return ULL2NUM(hval); + return LL2NUM((LONG_LONG)hval); #else # error unsupported platform #endif |