From 95d1b61a146f9e88564d3df7e648b78881741a61 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 28 Jul 2014 08:15:42 +0000 Subject: symbols instead of IDs * encoding.c (rb_enc_get_index): deal with symbols instead of IDs to get rid of inadvertent pin-downs. * enum.c (chunk_ii): ditto. * enumerator.c (append_method): ditto. * iseq.c (iseq_load): ditto. * marshal.c (w_symbol, r_symlink, r_symreal, r_symbol): ditto. * signal.c (trap_handler): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enumerator.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'enumerator.c') diff --git a/enumerator.c b/enumerator.c index bd75b006f9..eaa3d73464 100644 --- a/enumerator.c +++ b/enumerator.c @@ -975,13 +975,15 @@ append_method(VALUE obj, VALUE str, ID default_method, VALUE default_args) method = rb_attr_get(obj, id_method); if (method != Qfalse) { - ID mid = default_method; if (!NIL_P(method)) { Check_Type(method, T_SYMBOL); - mid = SYM2ID(method); + method = rb_sym2str(method); + } + else { + method = rb_id2str(default_method); } rb_str_buf_cat2(str, ":"); - rb_str_buf_append(str, rb_id2str(mid)); + rb_str_buf_append(str, method); } eargs = rb_attr_get(obj, id_arguments); -- cgit v1.2.3