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:
Jean Boussier 2024-04-16 15:30:00 +02:00 committed by Jean Boussier
parent 7380e3d30f
commit f06670c5a2
9 changed files with 22 additions and 22 deletions

View file

@ -418,7 +418,7 @@ nurat_s_new_internal(VALUE klass, VALUE num, VALUE den)
RATIONAL_SET_NUM((VALUE)obj, num);
RATIONAL_SET_DEN((VALUE)obj, den);
OBJ_FREEZE_RAW((VALUE)obj);
OBJ_FREEZE((VALUE)obj);
return (VALUE)obj;
}
@ -1847,7 +1847,7 @@ nurat_loader(VALUE self, VALUE a)
nurat_canonicalize(&num, &den);
RATIONAL_SET_NUM((VALUE)dat, num);
RATIONAL_SET_DEN((VALUE)dat, den);
OBJ_FREEZE_RAW(self);
OBJ_FREEZE(self);
return self;
}