summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2021-08-23 15:48:49 +0000
committerTony Cook <tony@develop-help.com>2021-08-25 14:41:55 +1000
commit364906c750e4f6e22ac4bb4d6b3742a1df87f976 (patch)
treedfcbbf27c3f94a44fc6e63c6055c91f89989585f /pp_sys.c
parent0f8b2f1e9307d973e41d064806756140723a2f31 (diff)
downloadperl-364906c750e4f6e22ac4bb4d6b3742a1df87f976.tar.gz
pp_tie should completely reset the underlying hash's iterator state.
Previously it would mangle it, resetting EITER but not RITER, meaning that after untie continuing iteration would be inconsistent - normally it would carry on exactly where it left off, but if iteration had been in the middle of a chain of HEs, it would skip the rest of the chain. Fixes GH #19077
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 2866959aa0..9b2d64ae2e 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -881,6 +881,7 @@ PP(pp_tie)
hv_free_ent((HV *)varsv, entry);
}
HvEITER_set(MUTABLE_HV(varsv), 0);
+ HvRITER_set(MUTABLE_HV(varsv), -1);
break;
}
case SVt_PVAV: