Skip to content

Commit 39697ff

Browse files
committed
Remove fields_tbl in gen_fields_lookup_ensure_size
1 parent 5342d91 commit 39697ff

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

variable.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,7 +1818,6 @@ general_field_set(VALUE obj, shape_id_t target_shape_id, VALUE val, void *data,
18181818
struct gen_fields_lookup_ensure_size {
18191819
VALUE obj;
18201820
ID id;
1821-
struct gen_fields_tbl *fields_tbl;
18221821
shape_id_t shape_id;
18231822
bool resize;
18241823
};
@@ -1829,11 +1828,11 @@ generic_ivar_set_shape_fields(VALUE obj, void *data)
18291828
RUBY_ASSERT(!rb_shape_obj_too_complex_p(obj));
18301829

18311830
struct gen_fields_lookup_ensure_size *fields_lookup = data;
1831+
struct gen_fields_tbl *fields_tbl = NULL;
18321832

18331833
// We can't use st_update, since when resizing the fields table GC can
18341834
// happen, which will modify the st_table and may rebuild it
18351835
RB_VM_LOCKING() {
1836-
struct gen_fields_tbl *fields_tbl = NULL;
18371836
st_table *tbl = generic_fields_tbl(obj, fields_lookup->id, false);
18381837
int existing = st_lookup(tbl, (st_data_t)obj, (st_data_t *)&fields_tbl);
18391838

@@ -1847,13 +1846,12 @@ generic_ivar_set_shape_fields(VALUE obj, void *data)
18471846
st_insert(tbl, (st_data_t)obj, (st_data_t)fields_tbl);
18481847
}
18491848

1850-
fields_lookup->fields_tbl = fields_tbl;
18511849
if (fields_lookup->shape_id) {
18521850
rb_obj_set_shape_id(fields_lookup->obj, fields_lookup->shape_id);
18531851
}
18541852
}
18551853

1856-
return fields_lookup->fields_tbl->as.shape.fields;
1854+
return fields_tbl->as.shape.fields;
18571855
}
18581856

18591857
static void

0 commit comments

Comments
 (0)