aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 85372ae696..ea9b4905ad 100644
--- a/compile.c
+++ b/compile.c
@@ -2248,8 +2248,12 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
if (piobj) {
struct rb_call_info *ci = (struct rb_call_info *)piobj->operands[0];
- rb_iseq_t *blockiseq = (rb_iseq_t *)piobj->operands[1];
- if (blockiseq == 0) {
+ if (piobj->insn_id == BIN(send) || piobj->insn_id == BIN(invokesuper)) {
+ if (piobj->operands[2] == 0) { /* no blockiseq */
+ ci->flag |= VM_CALL_TAILCALL;
+ }
+ }
+ else {
ci->flag |= VM_CALL_TAILCALL;
}
}