diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-07 11:08:52 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-07-07 11:08:52 +0000 |
commit | 68260018df64bdb0ba88316ed47e47e53c6c0617 (patch) | |
tree | baf6b20d34df6fca0bae83f7f41493933d49d0d4 /vm_args.c | |
parent | 9bb27fa318928464f5ab66649a75bbd034307baa (diff) | |
download | ruby-68260018df64bdb0ba88316ed47e47e53c6c0617.tar.gz |
* vm_args.c (vm_caller_setup_arg_block): disable symbol block
argument optimization when tail call optimization is enabled,
in order to avoid SEGV. [ruby-core:76288] [Bug #12565]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_args.c')
-rw-r--r-- | vm_args.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -778,7 +778,8 @@ vm_caller_setup_arg_block(const rb_thread_t *th, rb_control_frame_t *reg_cfp, if (NIL_P(proc)) { calling->blockptr = NULL; } - else if (SYMBOL_P(proc) && rb_method_basic_definition_p(rb_cSymbol, idTo_proc)) { + else if (LIKELY(!(ci->flag & VM_CALL_TAILCALL)) && SYMBOL_P(proc) && + rb_method_basic_definition_p(rb_cSymbol, idTo_proc)) { calling->blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(reg_cfp); calling->blockptr->iseq = (rb_iseq_t *)proc; calling->blockptr->proc = proc; |