ruby-changes:37438
From: nobu <ko1@a...>
Date: Fri, 6 Feb 2015 11:33:50 +0900 (JST)
Subject: [ruby-changes:37438] nobu:r49519 (trunk): variable.c: ignore mortal classid
nobu 2015-02-06 11:33:41 +0900 (Fri, 06 Feb 2015) New Revision: 49519 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49519 Log: variable.c: ignore mortal classid * variable.c (classname): ignore classid if it is a mortal symbol. Modified files: trunk/variable.c Index: variable.c =================================================================== --- variable.c (revision 49518) +++ variable.c (revision 49519) @@ -163,8 +163,9 @@ classname(VALUE klass, int *permanent) https://github.com/ruby/ruby/blob/trunk/variable.c#L163 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/