diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-19 03:21:52 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-19 03:21:52 +0000 |
commit | 6d6fe7fe6b430c39bcb05106994eb67a9486d580 (patch) | |
tree | 4896fc27726e0098fa19a7ed5f080bb329d6fd20 | |
parent | 84e892f85925b62bb538e811538bb34df392170d (diff) | |
download | ruby-6d6fe7fe6b430c39bcb05106994eb67a9486d580.tar.gz |
* proc.c (proc_call): Add gc guard to avoid segfault. The fix
is created by Tomoyuki Chikanaga. [Bug #4238][ruby-dev:42963]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | proc.c | 10 |
2 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Wed Jan 19 13:04:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * 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@segment7.net> * lib/rubygems/commands/dependency_command.rb: Remove require of @@ -543,16 +543,16 @@ proc_call(int argc, VALUE *argv, VALUE procval) 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; } } |