* parse.y (rb_check_id): make the given name a symbol or a string.

based on the second patch by Jeremy Evans at [ruby-core:38447]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-07-26 16:05:27 +00:00
parent de7e116e82
commit 3fbc65d47f
7 changed files with 26 additions and 19 deletions

View file

@ -10105,10 +10105,11 @@ rb_is_junk_id(ID id)
}
ID
rb_check_id(VALUE name)
rb_check_id(volatile VALUE *namep)
{
st_data_t id;
VALUE tmp;
VALUE name = *namep;
if (SYMBOL_P(name)) {
return SYM2ID(name);
@ -10121,6 +10122,7 @@ rb_check_id(VALUE name)
RSTRING_PTR(tmp));
}
name = tmp;
*namep = name;
}
if (rb_enc_str_coderange(name) == ENC_CODERANGE_BROKEN) {