diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-11 11:20:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-11 11:20:18 +0000 |
commit | 857b3018dd7b76828b0d61921cb24de59778765f (patch) | |
tree | 8d23f60b239e90b6524f3022b939f3432b89ec95 | |
parent | 7e6cf122efcea0aceda17feff2614fe6cda491c5 (diff) |
* 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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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)); } |