mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
84e892f859
commit
6d6fe7fe6b
2 changed files with 10 additions and 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>
|
Wed Jan 19 12:08:08 2011 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/rubygems/commands/dependency_command.rb: Remove require of
|
* lib/rubygems/commands/dependency_command.rb: Remove require of
|
||||||
|
|
10
proc.c
10
proc.c
|
@ -543,16 +543,16 @@ proc_call(int argc, VALUE *argv, VALUE procval)
|
||||||
rb_proc_t *proc;
|
rb_proc_t *proc;
|
||||||
rb_block_t *blockptr = 0;
|
rb_block_t *blockptr = 0;
|
||||||
rb_iseq_t *iseq;
|
rb_iseq_t *iseq;
|
||||||
|
VALUE passed_procval;
|
||||||
GetProcPtr(procval, proc);
|
GetProcPtr(procval, proc);
|
||||||
|
|
||||||
iseq = proc->block.iseq;
|
iseq = proc->block.iseq;
|
||||||
if (BUILTIN_TYPE(iseq) == T_NODE || iseq->arg_block != -1) {
|
if (BUILTIN_TYPE(iseq) == T_NODE || iseq->arg_block != -1) {
|
||||||
if (rb_block_given_p()) {
|
if (rb_block_given_p()) {
|
||||||
rb_proc_t *proc;
|
rb_proc_t *passed_proc;
|
||||||
VALUE procval;
|
RB_GC_GUARD(passed_procval) = rb_block_proc();
|
||||||
procval = rb_block_proc();
|
GetProcPtr(passed_procval, passed_proc);
|
||||||
GetProcPtr(procval, proc);
|
blockptr = &passed_proc->block;
|
||||||
blockptr = &proc->block;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue