ruby-changes:55402
From: tenderlove <ko1@a...>
Date: Fri, 19 Apr 2019 15:22:01 +0900 (JST)
Subject: [ruby-changes:55402] tenderlove:r67610 (trunk): Only mark the superclass if there is one
tenderlove 2019-04-19 15:21:55 +0900 (Fri, 19 Apr 2019) New Revision: 67610 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67610 Log: Only mark the superclass if there is one Some classes don't have a superclass, so we should check to see if it's there before marking. Modified files: trunk/gc.c Index: gc.c =================================================================== --- gc.c (revision 67609) +++ gc.c (revision 67610) @@ -4757,7 +4757,9 @@ gc_mark_children(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L4757 case T_CLASS: case T_MODULE: mark_m_tbl(objspace, RCLASS_M_TBL(obj)); - gc_mark(objspace, RCLASS_SUPER((VALUE)obj)); + if (RCLASS_SUPER((VALUE)obj)) { + gc_mark(objspace, RCLASS_SUPER((VALUE)obj)); + } if (!RCLASS_EXT(obj)) break; mark_tbl(objspace, RCLASS_IV_TBL(obj)); mark_const_tbl(objspace, RCLASS_CONST_TBL(obj)); @@ -4767,7 +4769,9 @@ gc_mark_children(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L4769 if (FL_TEST(obj, RICLASS_IS_ORIGIN)) { mark_m_tbl(objspace, RCLASS_M_TBL(obj)); } - gc_mark(objspace, RCLASS_SUPER((VALUE)obj)); + if (RCLASS_SUPER((VALUE)obj)) { + gc_mark(objspace, RCLASS_SUPER((VALUE)obj)); + } if (!RCLASS_EXT(obj)) break; mark_m_tbl(objspace, RCLASS_CALLABLE_M_TBL(obj)); break; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/