summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-19 04:16:13 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-19 04:16:13 +0000
commit0a02ad5e2e2cdd7e3dcb33f40eae056a8dfdc639 (patch)
tree19f7a084ea9527574b6ba382ccd770ff9e1b89e0 /compile.c
parentcd30220afff0d5473022bfb5749716364ebc05a8 (diff)
* 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
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 3 insertions, 0 deletions
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;