From 98a74d4dd5fa9cd45121e8ebfc2f787d316e924f Mon Sep 17 00:00:00 2001 From: tmm1 Date: Sun, 8 Dec 2013 01:39:27 +0000 Subject: 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 --- ext/-test-/symbol/type.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext/-test-/symbol') diff --git a/ext/-test-/symbol/type.c b/ext/-test-/symbol/type.c index e0b2fff2f9..17f2d6824b 100644 --- a/ext/-test-/symbol/type.c +++ b/ext/-test-/symbol/type.c @@ -35,9 +35,16 @@ bug_sym_attrset(VALUE self, VALUE name) return ID2SYM(id); } +static VALUE +bug_id2str(VALUE self, VALUE sym) +{ + return rb_id2str(SYM2ID(sym)); +} + void Init_type(VALUE klass) { FOREACH_ID_TYPES(declare_symbol_type_p); rb_define_singleton_method(klass, "attrset", bug_sym_attrset, 1); + rb_define_singleton_method(klass, "id2str", bug_id2str, 1); } -- cgit v1.2.3