summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-01-13 03:36:47 +0900
committerNARUSE, Yui <naruse@airemix.jp>2020-01-16 15:13:08 +0900
commit8e8841f6bf58031a1fe5b0dbacb5a1fb442102df (patch)
treee732a63e29041a07b1bd9a2c02f70a225d70a2f9 /hash.c
parent48f324e92f9b36edc267f9871e35039cbd1c2eb9 (diff)
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. [Bug #16503]
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 82383e9a93..1d97ccadd3 100644
--- a/hash.c
+++ b/hash.c
@@ -961,6 +961,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) {