Reduce exposure of FL_FREEZE

The `FL_FREEZE` flag is redundant with `SHAPE_ID_FL_FROZEN`, so
ideally it should be eliminated in favor of the later.

Doing so would eliminate the risk of desync between the two, but
also solve the problem of the frozen status being global in namespace
context (See Bug #21330).
This commit is contained in:
Jean Boussier 2025-06-24 11:46:40 +02:00
parent da10b956e0
commit 45a2c95d0f
8 changed files with 34 additions and 21 deletions

View file

@ -2771,7 +2771,8 @@ rb_freeze_singleton_class(VALUE x)
if (!RCLASS_SINGLETON_P(x)) {
VALUE klass = RBASIC_CLASS(x);
if (klass && // no class when hidden from ObjectSpace
FL_TEST(klass, (FL_SINGLETON|FL_FREEZE)) == FL_SINGLETON) {
FL_TEST_RAW(klass, FL_SINGLETON) &&
!OBJ_FROZEN_RAW(klass)) {
OBJ_FREEZE(klass);
}
}