1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

reload AR table body for transient heap.

ar_talbe (Hash representation for <=8 size) can use transient heap
and the memory area can move. So we need to restore `pair' ptr after
`func` call (which can run any programs) because of moving.
This commit is contained in:
Koichi Sasada 2020-01-13 03:36:47 +09:00
parent e288632f22
commit 350dafd56a

1
hash.c
View file

@ -974,6 +974,7 @@ ar_foreach_check(VALUE hash, st_foreach_check_callback_func *func, st_data_t arg
switch (retval) {
case ST_CHECK: {
pair = RHASH_AR_TABLE_REF(hash, i);
if (pair->key == never) break;
ret = ar_find_entry_hint(hash, hint, key);
if (ret == RHASH_AR_TABLE_MAX_BOUND) {