summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-09 08:32:37 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-09 08:32:37 +0000
commit0303a45d0399f089c4920b0bc10ac87482f839ec (patch)
tree21389fe2e8da83c20d7c5a3e2f27cfabed1958fc /compile.c
parent863396a5fef9d6ed213419279fa5165a68636724 (diff)
* compile.c (iseq_compile_each): Dynamic string literals should be
frozen. [ruby-core:57574] [Feature #8976] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index ba5f5be..5ad7625 100644
--- a/compile.c
+++ b/compile.c
@@ -5130,6 +5130,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
if (poped) {
ADD_INSN(ret, line, pop);
}
+ else {
+ if (iseq->compile_data->option->frozen_string_literal) {
+ ADD_SEND (ret, line, idFreeze, INT2FIX(0));
+ }
+ }
break;
}
case NODE_XSTR:{