summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/object.c b/object.c
index 3dc1243141..7253baa376 100644
--- a/object.c
+++ b/object.c
@@ -69,10 +69,17 @@ any_to_a(obj)
}
static VALUE
+obj_hash(obj)
+ VALUE obj;
+{
+ return (long)obj|FIXNUM_FLAG;
+}
+
+static VALUE
obj_id(obj)
VALUE obj;
{
- return INT2NUM((int)obj);
+ return INT2NUM((long)obj);
}
static VALUE
@@ -963,7 +970,7 @@ Init_Object()
rb_define_method(mKernel, "eql?", obj_equal, 1);
- rb_define_method(mKernel, "hash", obj_id, 0);
+ rb_define_method(mKernel, "hash", obj_hash, 0);
rb_define_method(mKernel, "id", obj_id, 0);
rb_define_method(mKernel, "__id__", obj_id, 0);
rb_define_method(mKernel, "type", obj_type, 0);