summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2020-10-28 16:58:17 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2020-10-28 18:35:22 -0700
commit9f3adaf5293d6347250df218bad9dcd3cd8da9ba (patch)
tree4128d9eda3dc0686cdcdf99964acafc2e7b6a478 /range.c
parentd8b0f1f7a84bf1ad85d649b125986ce181e79a58 (diff)
Use public allocators for creating new T_OBJECT objects
This way the header flags and object internals are set correctly
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3719
Diffstat (limited to 'range.c')
-rw-r--r--range.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/range.c b/range.c
index 15b3d573f56..2939ef37984 100644
--- a/range.c
+++ b/range.c
@@ -1676,10 +1676,7 @@ r_cover_p(VALUE range, VALUE beg, VALUE end, VALUE val)
static VALUE
range_dumper(VALUE range)
{
- VALUE v;
- NEWOBJ_OF(m, struct RObject, rb_cObject, T_OBJECT | (RGENGC_WB_PROTECTED_OBJECT ? FL_WB_PROTECTED : 1));
-
- v = (VALUE)m;
+ VALUE v = rb_obj_alloc(rb_cObject);
rb_ivar_set(v, id_excl, RANGE_EXCL(range));
rb_ivar_set(v, id_beg, RANGE_BEG(range));