mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ensure T_OBJECT objects have internals initialized
This commit is contained in:
parent
704fb0b815
commit
a8581ce673
Notes:
git
2020-11-05 07:41:31 +09:00
1 changed files with 5 additions and 1 deletions
6
gc.c
6
gc.c
|
@ -2304,7 +2304,11 @@ rb_newobj(void)
|
|||
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) \
|
||||
|
|
Loading…
Add table
Reference in a new issue