From e98b307036755d7da02a7d7c5723e5032796ca09 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Feb 2015 02:33:41 +0000 Subject: [PATCH] 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 --- variable.c | 5 +++-- 1 file 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);