summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2025-06-13 18:59:34 -0700
committerJohn Hawthorn <[email protected]>2025-06-13 23:29:41 -0700
commit39697ffd01f98b888a5585547ef8cbee4199c583 (patch)
treeae689eb718f4af7fc8b1332a637e9d20d8024c76 /variable.c
parent5342d9130beb44f9aa1dddbb7f6276bf01c7404f (diff)
Remove fields_tbl in gen_fields_lookup_ensure_size
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13589
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/variable.c b/variable.c
index b18ec1018a..6bd9f69d06 100644
--- a/variable.c
+++ b/variable.c
@@ -1818,7 +1818,6 @@ general_field_set(VALUE obj, shape_id_t target_shape_id, VALUE val, void *data,
struct gen_fields_lookup_ensure_size {
VALUE obj;
ID id;
- struct gen_fields_tbl *fields_tbl;
shape_id_t shape_id;
bool resize;
};
@@ -1829,11 +1828,11 @@ generic_ivar_set_shape_fields(VALUE obj, void *data)
RUBY_ASSERT(!rb_shape_obj_too_complex_p(obj));
struct gen_fields_lookup_ensure_size *fields_lookup = data;
+ struct gen_fields_tbl *fields_tbl = NULL;
// We can't use st_update, since when resizing the fields table GC can
// happen, which will modify the st_table and may rebuild it
RB_VM_LOCKING() {
- struct gen_fields_tbl *fields_tbl = NULL;
st_table *tbl = generic_fields_tbl(obj, fields_lookup->id, false);
int existing = st_lookup(tbl, (st_data_t)obj, (st_data_t *)&fields_tbl);
@@ -1847,13 +1846,12 @@ generic_ivar_set_shape_fields(VALUE obj, void *data)
st_insert(tbl, (st_data_t)obj, (st_data_t)fields_tbl);
}
- fields_lookup->fields_tbl = fields_tbl;
if (fields_lookup->shape_id) {
rb_obj_set_shape_id(fields_lookup->obj, fields_lookup->shape_id);
}
}
- return fields_lookup->fields_tbl->as.shape.fields;
+ return fields_tbl->as.shape.fields;
}
static void