summaryrefslogtreecommitdiffstats
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
commit980e14fdd9ba3b66551de35fb063e9a05b70da6e (patch)
tree19f7a084ea9527574b6ba382ccd770ff9e1b89e0 /compile.c
parent8b2c108c527baedd03b55284cf501477084e9726 (diff)
downloadruby-980e14fdd9ba3b66551de35fb063e9a05b70da6e.tar.gz
ruby-980e14fdd9ba3b66551de35fb063e9a05b70da6e.tar.xz
ruby-980e14fdd9ba3b66551de35fb063e9a05b70da6e.zip
* 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: http://svn.ruby-lang.org/repos/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 a5e997bd9..6e9caba55 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;