diff options
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -129,6 +129,11 @@ iseq_clear_ic_references_i(VALUE *code, VALUE insn, size_t index, void *data) if (rb_id_table_lookup(vm->constant_cache, id, (VALUE *) &ics)) { st_delete(ics, (st_data_t *) &ic_data->ic, (st_data_t *) NULL); + + if (ics->num_entries == 0) { + rb_id_table_delete(vm->constant_cache, id); + st_free_table(ics); + } } return true; |