summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-11 15:35:29 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-11 15:35:29 +0000
commitc5ee9b38687b66833081cb58f042b21c586a0142 (patch)
tree5f44ca3583ae4e97bdea70383d5db59818120acd /compile.c
parenta6f510959e409cb32e8da6a0b6417ac6325302eb (diff)
merge revision(s) 56208,56663: [Backport #12905]
* compile.c (iseq_peephole_optimize): enable tail call optimization inside a conditional block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index 1c29a721ac..f767dc4b05 100644
--- a/compile.c
+++ b/compile.c
@@ -2240,6 +2240,13 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
/*case BIN(trace):*/
next = next->next;
break;
+ case BIN(jump):
+ /* if cond
+ * return tailcall
+ * end
+ */
+ next = get_destination_insn((INSN *)next);
+ break;
case BIN(leave):
piobj = iobj;
default: