summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-08 14:20:58 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-06-08 14:20:58 +0000
commitd2d4589aebebd37080c8d96b6373d43283412f77 (patch)
treeb226bf0b6becd50f95c027133059e7bf07376bdb /hash.c
parent73cbf98fade83d3a5f9e7593b269cc7f35120935 (diff)
downloadruby-d2d4589aebebd37080c8d96b6373d43283412f77.tar.gz
ruby-d2d4589aebebd37080c8d96b6373d43283412f77.tar.xz
ruby-d2d4589aebebd37080c8d96b6373d43283412f77.zip
* gc.c (Init_stack): avoid __builtin_frame_address(2) to retrieve
stack bottom line. * st.c (numhash): should shuffle bits by dividing by prime number. * eval.c (rb_eval): multiple assignment behavior fixed, which results "*a = nil" makes "a == []" now. * eval.c (rb_f_require): should set SCOPE_PUBLIC before calling dln_load(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 2d99df3ce..f3c621ace 100644
--- a/hash.c
+++ b/hash.c
@@ -94,8 +94,11 @@ rb_any_hash(a)
default:
DEFER_INTS;
hval = rb_funcall(a, hash, 0);
- if (!FIXNUM_P(hval)) {
- hval = rb_funcall(hval, '%', 1, INT2FIX(65439));
+ if (FIXNUM_P(hval)) {
+ hval %= 536870917;
+ }
+ else {
+ hval = rb_funcall(hval, '%', 1, INT2FIX(536870917));
}
ENABLE_INTS;
return (int)FIX2LONG(hval);