diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2026-01-01 16:36:17 -0500 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2026-01-02 08:54:56 -0500 |
| commit | b9819ad06c883e6ea4f9e903c5bab06f175efb62 (patch) | |
| tree | b6df60e42238da5b493545775edbaa9d54f0520c | |
| parent | 177949c8b28587a0e0c0709d726cef846bdc51aa (diff) | |
Register a dupped identity hash as pinning
| -rw-r--r-- | hash.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1497,6 +1497,10 @@ rb_hash_new_capa(long capa) static VALUE hash_copy(VALUE ret, VALUE hash) { + if (rb_hash_compare_by_id_p(hash)) { + rb_gc_register_pinning_obj(ret); + } + if (RHASH_AR_TABLE_P(hash)) { if (RHASH_AR_TABLE_P(ret)) { ar_copy(ret, hash); |
