diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2026-05-18 11:17:24 +0200 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2026-05-18 13:06:04 +0300 |
| commit | e4e1c92a1dde6e7bcdadc254306940d005835642 (patch) | |
| tree | d1aa08adc7e4a368d1aa8d94bac7d5353681af6a | |
| parent | d036506b15e0fe34a36b00cfd461d409b1fcc97d (diff) | |
Followup: https://github.com/ruby/ruby/pull/17016
`cdhash` is no longer a RHash, also its values are no
longer boxed.
| -rw-r--r-- | compile.c | 2 | ||||
| -rw-r--r-- | iseq.c | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -12204,7 +12204,7 @@ iseq_build_from_ary_body(rb_iseq_t *iseq, LINK_ANCHOR *const anchor, VALUE sym = RARRAY_AREF(op, i+1); LABEL *label = register_label(iseq, labels_table, sym); - rb_hash_aset(map, key, (VALUE)label | 1); + cdhash_aset(map, key, (VALUE)label); } RB_GC_GUARD(op); RB_OBJ_SET_SHAREABLE(map); // allow mutation while compiling @@ -3340,7 +3340,7 @@ static int cdhash_each(VALUE key, VALUE value, VALUE ary) { rb_ary_push(ary, obj_resurrect(key)); - rb_ary_push(ary, value); + rb_ary_push(ary, INT2FIX(value)); return ST_CONTINUE; } @@ -3581,11 +3581,11 @@ iseq_data_to_ary(const rb_iseq_t *iseq) break; case TS_CDHASH: { - VALUE hash = *seq; + VALUE cdhash = *seq; VALUE val = rb_ary_new(); int i; - rb_hash_foreach(hash, cdhash_each, val); + st_foreach(rb_imemo_cdhash_tbl(cdhash), cdhash_each, val); for (i=0; i<RARRAY_LEN(val); i+=2) { VALUE pos = FIX2INT(rb_ary_entry(val, i+1)); |
