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
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue