Skip to content

Commit 9375d30

Browse files
WIP: Fix Free at exit
I don't think this is the correct fix. There's an object that has enough flags to identify as a T_DATA, but everything else is NULL. When free at exit is running, we end up trying to free it's object_id, which at the moment is naively assuming that we can just look up the shape and it'll be fine, but the shape lookup is returning NULL in this case and so the flag check on the shape is failing. what I've done here is almost certainly not the correct fix, but I just want FREE_AT_EXIT to be quiet, so I can see the proper issues in the CI tests.
1 parent 9ffb19d commit 9375d30

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

shape.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ bool rb_shape_set_shape_id(VALUE obj, shape_id_t shape_id);
238238
static inline bool
239239
rb_shape_obj_has_id(VALUE obj)
240240
{
241-
return rb_shape_has_object_id(rb_shape_get_shape(obj));
241+
shape_id_t shape_id = rb_shape_get_shape_id(obj);
242+
return (shape_id != ROOT_SHAPE_ID) && rb_shape_has_object_id(rb_shape_get_shape_by_id(shape_id));
242243
}
243244

244245
VALUE rb_obj_debug_shape(VALUE self, VALUE obj);

0 commit comments

Comments
 (0)