newobj_fill: don't assume RBasic size
The previous implementation assumed `RBasic` size is `2 * sizeof(VALUE)`, might as well not make assumption and use a proper `sizeof`. Co-Authored-By: John Hawthorn <john@hawthorn.email>
This commit is contained in:
parent
186e60cb68
commit
3d1b8e7298
Notes:
git
2025-05-15 11:26:38 +00:00
@ -2073,10 +2073,10 @@ heap_prepare(rb_objspace_t *objspace, rb_heap_t *heap)
|
||||
static inline VALUE
|
||||
newobj_fill(VALUE obj, VALUE v1, VALUE v2, VALUE v3)
|
||||
{
|
||||
VALUE *p = (VALUE *)obj;
|
||||
p[2] = v1;
|
||||
p[3] = v2;
|
||||
p[4] = v3;
|
||||
VALUE *p = (VALUE *)(obj + sizeof(struct RBasic));
|
||||
p[0] = v1;
|
||||
p[1] = v2;
|
||||
p[2] = v3;
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user