ruby-changes:63519
From: Aaron <ko1@a...>
Date: Thu, 5 Nov 2020 07:41:22 +0900 (JST)
Subject: [ruby-changes:63519] a8581ce673 (master): ensure T_OBJECT objects have internals initialized
https://git.ruby-lang.org/ruby.git/commit/?id=a8581ce673 From a8581ce673e14ba5ff48d0a3cb71368daa82558b Mon Sep 17 00:00:00 2001 From: Aaron Patterson <tenderlove@r...> Date: Wed, 4 Nov 2020 11:33:59 -0800 Subject: ensure T_OBJECT objects have internals initialized diff --git a/gc.c b/gc.c index 6587689..abc311a 100644 --- a/gc.c +++ b/gc.c @@ -2304,7 +2304,11 @@ rb_newobj(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L2304 VALUE rb_newobj_of(VALUE klass, VALUE flags) { - return newobj_of(klass, flags & ~FL_WB_PROTECTED, 0, 0, 0, flags & FL_WB_PROTECTED); + if ((flags & RUBY_T_MASK) == T_OBJECT) { + return newobj_of(klass, (flags | ROBJECT_EMBED) & ~FL_WB_PROTECTED , Qundef, Qundef, Qundef, flags & FL_WB_PROTECTED); + } else { + return newobj_of(klass, flags & ~FL_WB_PROTECTED, 0, 0, 0, flags & FL_WB_PROTECTED); + } } #define UNEXPECTED_NODE(func) \ -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/