summaryrefslogtreecommitdiff
path: root/vm_args.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-30 03:31:58 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-30 03:31:58 +0000
commitaeb980bdc6b821ccd0db3c6b8639305f7942118f (patch)
tree176810cb388fc2d3109420d2c7472026450a49d6 /vm_args.c
parent446bb33fa30f6339b3c20a36db0280315621dfd1 (diff)
merge revision(s) 55605: [Backport #12565]
* 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/branches/ruby_2_3@55779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_args.c')
-rw-r--r--vm_args.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm_args.c b/vm_args.c
index 2546b86e8e..037fb09c1f 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -780,7 +780,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;