summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-06-04 11:58:14 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-06-04 14:34:30 -0700
commitfb2352ebbcdd380053ad8408a0613965b0ec2950 (patch)
tree97471c28069315b6940886ea3aa2a9355ec2bd43 /hv.c
parente5accad2c334d0d98a2eb0bcfa8f8363dfc3c78a (diff)
downloadperl-fb2352ebbcdd380053ad8408a0613965b0ec2950.tar.gz
Allow restricted hashes containing COWs to be cleared
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index 01ecf3972a..51c782a3bf 100644
--- a/hv.c
+++ b/hv.c
@@ -1554,7 +1554,8 @@ Perl_hv_clear(pTHX_ HV *hv)
for (; entry; entry = HeNEXT(entry)) {
/* not already placeholder */
if (HeVAL(entry) != &PL_sv_placeholder) {
- if (HeVAL(entry) && SvREADONLY(HeVAL(entry))) {
+ if (HeVAL(entry) && SvREADONLY(HeVAL(entry))
+ && !SvIsCOW(HeVAL(entry))) {
SV* const keysv = hv_iterkeysv(entry);
Perl_croak(aTHX_
"Attempt to delete readonly key '%"SVf"' from a restricted hash",