mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* 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:
parent
de7e116e82
commit
3fbc65d47f
7 changed files with 26 additions and 19 deletions
4
parse.y
4
parse.y
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue