summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-09 07:26:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-09 07:26:21 +0000
commit87beea44969367180d255f56c4001348cf41d210 (patch)
tree1c6ff993469e69370eaaf3116eefc1eab035dbac /gc.c
parent39711489a44a1c0ed02b0a605d3e83558b3b8dd3 (diff)
* enum.c (enum_inject): new method.
* gc.c (rb_gc_call_finalizer_at_exit): clear klass member of terminating object. * eval.c (rb_call): raise exception for terminated object. * bignum.c (bigdivrem): t2 might be too big for signed long; do not use rb_int2big(), but rb_uint2big(). * error.c (rb_load_fail): new func to report LoadError. * ruby.c (load_file): use rb_load_fail. * eval.c (ruby_finalize): should enclosed by PUSH_TAG/POP_TAG. * gc.c (rb_gc_mark): link 2 of NODE_IFUNC should not be explicitly marked. it may contain non object pointer. * re.c (reg_s_last_match): Regexp::last_match(nth) returns nth substring of the match (alternative for $& and $<digit>). * eval.c (rb_mod_define_method): wrong comparison for blocks. * gc.c (id2ref): should handle Symbol too. * gc.c (id2ref): should print original ptr value * eval.c (rb_iterate): NODE_CFUNC does not protect its data (nd_tval), so create new node NODE_IFUNC for iteration C function. * eval.c (rb_yield_0): use NODE_IFUNC. * gc.c (rb_gc_mark): support NODE_IFUNC. * gc.c (mem_error): prohibit recursive mem_error(). (ruby-bugs-ja:PR#36) * eval.c (rb_thread_fd_writable): should not switch context if rb_thread_critical is set. * eval.c (rb_thread_wait_fd): ditto. * eval.c (rb_thread_wait_for): ditto. * eval.c (rb_thread_select): ditto. * eval.c (rb_thread_join): join during critical section causes deadlock. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gc.c b/gc.c
index 65803a3860..e4320e0a4f 100644
--- a/gc.c
+++ b/gc.c
@@ -480,7 +480,6 @@ rb_gc_mark(ptr)
case NODE_OP_ASGN_AND:
rb_gc_mark(obj->as.node.u1.node);
/* fall through */
- case NODE_IFUNC:
case NODE_METHOD: /* 2 */
case NODE_NOT:
case NODE_GASGN:
@@ -1232,7 +1231,8 @@ rb_gc_call_finalizer_at_exit()
p = heaps[i]; pend = p + HEAP_SLOTS;
while (p < pend) {
if (FL_TEST(p, FL_FINALIZE)) {
- p->as.free.flag = 0;
+ FL_UNSET(p, FL_FINALIZE);
+ p->as.basic.klass = 0;
run_final((VALUE)p);
}
p++;
@@ -1260,21 +1260,22 @@ static VALUE
id2ref(obj, id)
VALUE obj, id;
{
- unsigned long ptr;
+ unsigned long ptr, p0;
rb_secure(4);
- ptr = NUM2UINT(id);
+ p0 = ptr = NUM2UINT(id);
if (FIXNUM_P(ptr)) return (VALUE)ptr;
+ if (SYMBOL_P(ptr)) return (VALUE)ptr;
if (ptr == Qtrue) return Qtrue;
if (ptr == Qfalse) return Qfalse;
if (ptr == Qnil) return Qnil;
ptr = id ^ FIXNUM_FLAG; /* unset FIXNUM_FLAG */
if (!is_pointer_to_heap(ptr)) {
- rb_raise(rb_eRangeError, "0x%x is not id value", ptr);
+ rb_raise(rb_eRangeError, "0x%x is not id value", p0);
}
if (BUILTIN_TYPE(ptr) == 0) {
- rb_raise(rb_eRangeError, "0x%x is recycled object", ptr);
+ rb_raise(rb_eRangeError, "0x%x is recycled object", p0);
}
return (VALUE)ptr;
}