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
Родитель e288632f22
Коммит 350dafd56a
1 изменённых файлов: 1 добавлений и 0 удалений

1
hash.c
Просмотреть файл

@ -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) {