From 350dafd56a9cff58d36303aeb7515ab41c5dbbb3 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Mon, 13 Jan 2020 03:36:47 +0900 Subject: 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. --- hash.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hash.c b/hash.c index 878f2b1790..644f85d6da 100644 --- a/hash.c +++ b/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) { -- cgit v1.2.3