ruby-changes:18577
From: kosaki <ko1@a...>
Date: Wed, 19 Jan 2011 12:22:01 +0900 (JST)
Subject: [ruby-changes:18577] Ruby:r30601 (trunk): * proc.c (proc_call): Add gc guard to avoid segfault. The fix
kosaki 2011-01-19 12:21:52 +0900 (Wed, 19 Jan 2011) New Revision: 30601 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30601 Log: * proc.c (proc_call): Add gc guard to avoid segfault. The fix is created by Tomoyuki Chikanaga. [Bug #4238][ruby-dev:42963] Modified files: trunk/ChangeLog trunk/proc.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30600) +++ ChangeLog (revision 30601) @@ -1,3 +1,8 @@ +Wed Jan 19 13:04:16 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * proc.c (proc_call): Add gc guard to avoid segfault. The fix + is created by Tomoyuki Chikanaga. [Bug #4238][ruby-dev:42963] + Wed Jan 19 12:08:08 2011 Eric Hodel <drbrain@s...> * lib/rubygems/commands/dependency_command.rb: Remove require of Index: proc.c =================================================================== --- proc.c (revision 30600) +++ proc.c (revision 30601) @@ -543,16 +543,16 @@ rb_proc_t *proc; rb_block_t *blockptr = 0; rb_iseq_t *iseq; + VALUE passed_procval; GetProcPtr(procval, proc); iseq = proc->block.iseq; if (BUILTIN_TYPE(iseq) == T_NODE || iseq->arg_block != -1) { if (rb_block_given_p()) { - rb_proc_t *proc; - VALUE procval; - procval = rb_block_proc(); - GetProcPtr(procval, proc); - blockptr = &proc->block; + rb_proc_t *passed_proc; + RB_GC_GUARD(passed_procval) = rb_block_proc(); + GetProcPtr(passed_procval, passed_proc); + blockptr = &passed_proc->block; } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/