summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-06-04 11:54:10 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-06-04 14:34:30 -0700
commite5accad2c334d0d98a2eb0bcfa8f8363dfc3c78a (patch)
tree93bb5bd3e7fbe2978310c451a9bd0c14b916bb31 /hv.c
parenta130272381198bb249482fb77a994df28ddaf3bf (diff)
downloadperl-e5accad2c334d0d98a2eb0bcfa8f8363dfc3c78a.tar.gz
Allow COW values to be deleted from restricted hashes
I wonder how many other things a604c75 broke....
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 aa1783ebea..01ecf3972a 100644
--- a/hv.c
+++ b/hv.c
@@ -1003,7 +1003,8 @@ S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
Safefree(key);
return NULL;
}
- if (SvREADONLY(hv) && HeVAL(entry) && SvREADONLY(HeVAL(entry))) {
+ if (SvREADONLY(hv) && HeVAL(entry) && SvREADONLY(HeVAL(entry))
+ && !SvIsCOW(HeVAL(entry))) {
hv_notallowed(k_flags, key, klen,
"Attempt to delete readonly key '%"SVf"' from"
" a restricted hash");