summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-13 05:10:46 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-02-13 05:10:46 +0000
commit2db6b52feb61614cad74ce417d66b8af09ba39db (patch)
tree8d34430272d3aa8a2c0dd4918766b96da7f86782 /hash.c
parente393a67aa9fa9a5a6c2ed1f051dc93c1d239012f (diff)
* parse.y (primary): preserve and clear in_single and in_def using
stack to prevent nested method errors in singleton class bodies. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/hash.c b/hash.c
index 2a5803c96e..eb6e73908c 100644
--- a/hash.c
+++ b/hash.c
@@ -79,16 +79,16 @@ static int
rb_any_hash(a)
VALUE a;
{
- unsigned int hval;
+ VALUE hval;
switch (TYPE(a)) {
case T_FIXNUM:
case T_SYMBOL:
- hval = a;
+ return (int)a;
break;
case T_STRING:
- hval = rb_str_hash(a);
+ return rb_str_hash(a);
break;
default:
@@ -98,9 +98,8 @@ rb_any_hash(a)
hval = rb_funcall(hval, '%', 1, INT2FIX(65439));
}
ENABLE_INTS;
- hval = FIX2LONG(hval);
+ return (int)FIX2LONG(hval);
}
- return hval;
}
static struct st_hash_type objhash = {