diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-06 02:33:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-06 02:33:41 +0000 |
commit | e98b307036755d7da02a7d7c5723e5032796ca09 (patch) | |
tree | 5ab6115b2d4dc4b8667d37b625092398f22fcb5a | |
parent | 536ef60a6897603b615b4d24eab6c0fcfbf07596 (diff) | |
download | ruby-e98b307036755d7da02a7d7c5723e5032796ca09.tar.gz |
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
-rw-r--r-- | variable.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/variable.c b/variable.c index 1395f5d625..68235ab86d 100644 --- a/variable.c +++ b/variable.c @@ -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); |