ruby-changes:48536
From: nobu <ko1@a...>
Date: Sat, 4 Nov 2017 23:32:53 +0900 (JST)
Subject: [ruby-changes:48536] nobu:r60651 (trunk): gc.c: UNEXPECTED_NODE
nobu 2017-11-04 23:32:48 +0900 (Sat, 04 Nov 2017) New Revision: 60651 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60651 Log: gc.c: UNEXPECTED_NODE * gc.c (UNEXPECTED_NODE): extract rb_bug for T_NODE. Modified files: trunk/gc.c Index: gc.c =================================================================== --- gc.c (revision 60650) +++ gc.c (revision 60651) @@ -2000,6 +2000,10 @@ rb_newobj_of(VALUE klass, VALUE flags) https://github.com/ruby/ruby/blob/trunk/gc.c#L2000 return newobj_of(klass, flags & ~FL_WB_PROTECTED, 0, 0, 0, flags & FL_WB_PROTECTED); } +#define UNEXPECTED_NODE(func) \ + rb_bug(#func"(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, \ + BUILTIN_TYPE(obj), (void*)(obj), RBASIC(obj)->flags) + #undef rb_imemo_new VALUE @@ -2320,8 +2324,7 @@ obj_free(rb_objspace_t *objspace, VALUE https://github.com/ruby/ruby/blob/trunk/gc.c#L2324 break; case T_NODE: - rb_bug("obj_free(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); + UNEXPECTED_NODE(obj_free); break; case T_STRUCT: @@ -2526,9 +2529,8 @@ internal_object_p(VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L2529 if (p->as.basic.flags) { switch (BUILTIN_TYPE(p)) { case T_NODE: - rb_bug("internal_object_p(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); - break; + UNEXPECTED_NODE(internal_object_p); + break; case T_NONE: case T_IMEMO: case T_ICLASS: @@ -3302,8 +3304,7 @@ obj_memsize_of(VALUE obj, int use_all_ty https://github.com/ruby/ruby/blob/trunk/gc.c#L3304 break; case T_NODE: - rb_bug("obj_memsize_of(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); + UNEXPECTED_NODE(obj_memsize_of); break; case T_STRUCT: @@ -4568,8 +4569,7 @@ gc_mark_children(rb_objspace_t *objspace https://github.com/ruby/ruby/blob/trunk/gc.c#L4569 break; case T_NODE: - rb_bug("rb_gc_mark(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); + UNEXPECTED_NODE(rb_gc_mark); break; case T_IMEMO: @@ -9327,8 +9327,7 @@ rb_raw_obj_info(char *buff, const int bu https://github.com/ruby/ruby/blob/trunk/gc.c#L9327 switch (type) { case T_NODE: - rb_bug("rb_raw_obj_info(): GC does not handle T_NODE 0x%x(%p) 0x%"PRIxVALUE, - BUILTIN_TYPE(obj), (void*)obj, RBASIC(obj)->flags); + UNEXPECTED_NODE(rb_raw_obj_info); break; case T_ARRAY: snprintf(buff, buff_size, "%s [%s%s] len: %d", buff, -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/