summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-06 02:33:41 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-06 02:33:41 (GMT)
commite98b307036755d7da02a7d7c5723e5032796ca09 (patch)
tree5ab6115b2d4dc4b8667d37b625092398f22fcb5a /variable.c
parent536ef60a6897603b615b4d24eab6c0fcfbf07596 (diff)
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
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/variable.c b/variable.c
index 1395f5d..68235ab 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);