mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
variable.c: ignore mortal classid
* variable.c (classname): ignore classid if it is a mortal symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
536ef60a68
commit
e98b307036
1 changed files with 3 additions and 2 deletions
|
@ -163,8 +163,9 @@ classname(VALUE klass, int *permanent)
|
|||
if (!st_lookup(RCLASS_IV_TBL(klass), (st_data_t)classpath, &n)) {
|
||||
ID cid = 0;
|
||||
if (st_lookup(RCLASS_IV_TBL(klass), (st_data_t)classid, &n)) {
|
||||
cid = SYM2ID(n);
|
||||
path = find_class_path(klass, cid);
|
||||
VALUE cname = (VALUE)n;
|
||||
cid = rb_check_id(&cname);
|
||||
if (cid) path = find_class_path(klass, cid);
|
||||
}
|
||||
if (NIL_P(path)) {
|
||||
path = find_class_path(klass, (ID)0);
|
||||
|
|
Loading…
Reference in a new issue