From 0a02ad5e2e2cdd7e3dcb33f40eae056a8dfdc639 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 19 Aug 2007 04:16:13 +0000 Subject: * compile.c (iseq_compile_each/NODE_RESBODY): fix to add additional nop to prevent tailcall optimization. * vm_opts.h: clean up comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compile.c') diff --git a/compile.c b/compile.c index a5e997bd92..6e9caba554 100644 --- a/compile.c +++ b/compile.c @@ -3119,6 +3119,9 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) ADD_INSNL(ret, nd_line(node), jump, label_miss); ADD_LABEL(ret, label_hit); COMPILE(ret, "resbody body", resq->nd_body); + if (iseq->compile_data->option->tailcall_optimization) { + ADD_INSN(ret, nd_line(node), nop); + } ADD_INSN(ret, nd_line(node), leave); ADD_LABEL(ret, label_miss); resq = resq->nd_head; -- cgit v1.2.3