summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authortmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 01:39:27 +0000
committertmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 01:39:27 +0000
commit98a74d4dd5fa9cd45121e8ebfc2f787d316e924f (patch)
treee8cdc2094b7dd1cdc57ecd58916413439d5ba663 /parse.y
parent100fe2e659339318846168841fd76ed4e38a6210 (diff)
parse.y: use rb_fstring() for strings stored in the symbol table
* parse.y (register_symid_str): use fstrings in symbol table [Bug #9171] [ruby-core:58656] * parse.y (rb_id2str): ditto * string.c (rb_fstring): create frozen_strings on first usage. this allows rb_fstring() calls from the parser (before cString is created) * string.c (fstring_set_class_i): set klass on fstrings generated before cString was defined * string.c (Init_String): convert frozen_strings table to String objects after boot * ext/-test-/symbol/type.c (bug_sym_id2str): expose rb_id2str() * test/-ext-/symbol/test_type.rb (module Test_Symbol): verify symbol table entries are fstrings git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 8207ad7133..2a0c5c64f7 100644
--- a/parse.y
+++ b/parse.y
@@ -10334,6 +10334,7 @@ static ID
register_symid_str(ID id, VALUE str)
{
OBJ_FREEZE(str);
+ str = rb_fstring(str);
if (RUBY_DTRACE_SYMBOL_CREATE_ENABLED()) {
RUBY_DTRACE_SYMBOL_CREATE(RSTRING_PTR(str), rb_sourcefile(), rb_sourceline());
@@ -10544,6 +10545,7 @@ rb_id2str(ID id)
name[1] = 0;
str = rb_usascii_str_new(name, 1);
OBJ_FREEZE(str);
+ str = rb_fstring(str);
global_symbols.op_sym[i] = str;
global_symbols.minor_marked = 0;
}
@@ -10555,6 +10557,7 @@ rb_id2str(ID id)
if (!str) {
str = rb_usascii_str_new2(op_tbl[i].name);
OBJ_FREEZE(str);
+ str = rb_fstring(str);
global_symbols.op_sym[i] = str;
global_symbols.minor_marked = 0;
}