diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | bootstraptest/test_proc.rb | 7 | ||||
-rw-r--r-- | proc.c | 1 |
3 files changed, 14 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Fri Jan 11 20:20:16 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * proc.c (proc_mark): needs to mark the receiver too. a patch from + Chris Heath <chris AT heathens.co.nz> in [ruby-core:14983]. + [ruby-core:14885] + Fri Jan 11 18:28:49 2008 Eric Hodel <drbrain@segment7.net> * lib/rdoc/usage.rb: Removed. diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb index 049bc99131..875a000b7c 100644 --- a/bootstraptest/test_proc.rb +++ b/bootstraptest/test_proc.rb @@ -253,3 +253,10 @@ assert_equal %q{3}, %q{ a + 2 }.call } + +assert_equal %q{ok}, %q{ + class A; def get_block; proc {puts "ok"} end end + block = A.new.get_block + GC.start + block.call +} @@ -52,6 +52,7 @@ proc_mark(void *ptr) RUBY_MARK_UNLESS_NULL(proc->blockprocval); RUBY_MARK_UNLESS_NULL((VALUE)proc->special_cref_stack); RUBY_MARK_UNLESS_NULL(proc->block.proc); + RUBY_MARK_UNLESS_NULL(proc->block.self); if (proc->block.iseq && RUBY_VM_IFUNC_P(proc->block.iseq)) { RUBY_MARK_UNLESS_NULL((VALUE)(proc->block.iseq)); } |