summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2025-06-07 13:42:46 +0200
committerJean Boussier <[email protected]>2025-06-07 18:30:44 +0200
commit2de67d424fa94722099d1b28c803a6cd49364607 ()
treeb14ceacdd60282a9a845b0fdfa60d38cd1800909
parent8c4e368dcf9e50814ed8a65a824f22035bbe6770 (diff)
shape.c: assert we're not returning INVALID_SHAPE_ID.
Notes: Merged: https://.com/ruby/ruby/pull/13556
-rw-r--r--shape.c8
1 files changed, 2 insertions, 6 deletions
@@ -357,18 +357,14 @@ static const rb_data_type_t shape_tree_type = {
static inline shape_id_t
raw_shape_id(rb_shape_t *shape)
{
- if (shape == NULL) {
- return INVALID_SHAPE_ID;
- }
return (shape_id_t)(shape - GET_SHAPE_TREE()->shape_list);
}
static inline shape_id_t
shape_id(rb_shape_t *shape, shape_id_t previous_shape_id)
{
- if (shape == NULL) {
- return INVALID_SHAPE_ID;
- }
shape_id_t raw_id = (shape_id_t)(shape - GET_SHAPE_TREE()->shape_list);
return raw_id | (previous_shape_id & SHAPE_ID_FLAGS_MASK);
}