summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-04 06:28:51 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-04 06:28:51 +0000
commit00f61076211a110d28cbdb3535194d2ea1a439d3 (patch)
treef6a946c95ae3a014230805b64f95d3b4911b8083 /gc.c
parent6a2ba1c4a2e6578efde974efcf2689b59a306ad8 (diff)
* gc.c (id2ref): fix symbol test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gc.c b/gc.c
index f961001..8a98df8 100644
--- a/gc.c
+++ b/gc.c
@@ -1912,15 +1912,15 @@ id2ref(obj, objid)
if (ptr == Qfalse) return Qfalse;
if (ptr == Qnil) return Qnil;
if (FIXNUM_P(ptr)) return (VALUE)ptr;
+ ptr = objid ^ FIXNUM_FLAG; /* unset FIXNUM_FLAG */
- if ((objid % sizeof(RVALUE)) == (4 << 2)) {
- ID symid = objid / sizeof(RVALUE);
+ if ((ptr % sizeof(RVALUE)) == (4 << 2)) {
+ ID symid = ptr / sizeof(RVALUE);
if (rb_id2name(symid) == 0)
rb_raise(rb_eRangeError, "%p is not symbol id value", p0);
return ID2SYM(symid);
}
- ptr = objid ^ FIXNUM_FLAG; /* unset FIXNUM_FLAG */
if (!is_pointer_to_heap((void *)ptr)|| BUILTIN_TYPE(ptr) >= T_BLKTAG) {
rb_raise(rb_eRangeError, "0x%lx is not id value", p0);
}