mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Eliminate usage of OBJ_FREEZE_RAW
Previously it would bypass the `FL_ABLE` check, but since shapes introduction, it started having a different behavior than `OBJ_FREEZE`, as it would onyl set the `FL_FREEZE` flag, but not update the shape. I have no indication of this causing a bug yet, but it seems like a trap waiting to happen.
This commit is contained in:
parent
7380e3d30f
commit
f06670c5a2
9 changed files with 22 additions and 22 deletions
2
class.c
2
class.c
|
@ -2273,7 +2273,7 @@ rb_freeze_singleton_class(VALUE x)
|
|||
VALUE klass = RBASIC_CLASS(x);
|
||||
if (klass && // no class when hidden from ObjectSpace
|
||||
FL_TEST(klass, (FL_SINGLETON|FL_FREEZE)) == FL_SINGLETON) {
|
||||
OBJ_FREEZE_RAW(klass);
|
||||
OBJ_FREEZE(klass);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue