Hi,

At Sun, 9 Jul 2006 22:20:04 +0900,
<noreply / rubyforge.org> wrote in [ruby-core:08180]:
> Here's the offending piece of code:
> 
> module M; extend M; def f; puts 'hi'; end end
> M.f
> # hi
> Module M; remove_method :f; end
> M.f
> # hi
> 
> In IRB, continue with:
> GC.start
> M.f
> (irb):7: [BUG] terminated node (0xb71dc90c)
> ruby 1.8.4 (2005-12-24) [i486-linux]

Does this fix it?


Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.616.2.177 diff -p -u -2 -r1.616.2.177 eval.c --- eval.c 8 Jul 2006 15:55:37 -0000 1.616.2.177 +++ eval.c 9 Jul 2006 15:58:22 -0000 @@ -367,5 +367,6 @@ rb_clear_cache_for_undef(klass, id) ent = cache; end = ent + CACHE_SIZE; while (ent < end) { - if (ent->origin == klass && ent->mid == id) { + if (ent->mid == id && + RCLASS(ent->origin)->m_tbl == RCLASS(klass)->m_tbl) { ent->mid = 0; }
-- Nobu Nakada