mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
863396a5fe
commit
0303a45d03
3 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Mon Nov 9 17:29:09 2015 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* compile.c (iseq_compile_each): Dynamic string literals should be
|
||||||
|
frozen.
|
||||||
|
[ruby-core:57574] [Feature #8976]
|
||||||
|
|
||||||
Mon Nov 9 15:56:07 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
Mon Nov 9 15:56:07 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||||
|
|
||||||
* common.mk: Use ruby organization url for simplecov repository.
|
* common.mk: Use ruby organization url for simplecov repository.
|
||||||
|
|
|
@ -5130,6 +5130,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
|
||||||
if (poped) {
|
if (poped) {
|
||||||
ADD_INSN(ret, line, pop);
|
ADD_INSN(ret, line, pop);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (iseq->compile_data->option->frozen_string_literal) {
|
||||||
|
ADD_SEND (ret, line, idFreeze, INT2FIX(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NODE_XSTR:{
|
case NODE_XSTR:{
|
||||||
|
|
|
@ -175,7 +175,7 @@ class TestISeq < Test::Unit::TestCase
|
||||||
s1, s2, s3, s4 = compile(code, line, {frozen_string_literal: true}).eval
|
s1, s2, s3, s4 = compile(code, line, {frozen_string_literal: true}).eval
|
||||||
assert_predicate(s1, :frozen?)
|
assert_predicate(s1, :frozen?)
|
||||||
assert_predicate(s2, :frozen?)
|
assert_predicate(s2, :frozen?)
|
||||||
assert_not_predicate(s3, :frozen?)
|
assert_predicate(s3, :frozen?)
|
||||||
assert_predicate(s4, :frozen?)
|
assert_predicate(s4, :frozen?)
|
||||||
assert_same(s1, s2)
|
assert_same(s1, s2)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue