summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-08-06 18:19:08 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-11 07:41:26 -0700
commit0ffdaf1a47312f763d4610e9ec65c24561e957a5 (patch)
tree8dd34cbc20ebccd72f00c3d3a56670b99b0630cf /hv.c
parentd8b516a1046e5fdab4de366564c3388df9504b5d (diff)
downloadperl-0ffdaf1a47312f763d4610e9ec65c24561e957a5.tar.gz
Don’t treat COWs specially in locked hashes
This is left over from when READONLY+FAKE meant copy-on-write. Read-only copy-on-write scalars (which could not occur with the old way of flagging things) must not be exempt from hash key restrictions.
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hv.c b/hv.c
index 22d5603fe0..02fe607cfd 100644
--- a/hv.c
+++ b/hv.c
@@ -1062,8 +1062,7 @@ 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))
- && !SvIsCOW(HeVAL(entry))) {
+ if (SvREADONLY(hv) && HeVAL(entry) && SvREADONLY(HeVAL(entry))) {
hv_notallowed(k_flags, key, klen,
"Attempt to delete readonly key '%"SVf"' from"
" a restricted hash");
@@ -1537,7 +1536,7 @@ Perl_hv_clear(pTHX_ HV *hv)
/* not already placeholder */
if (HeVAL(entry) != &PL_sv_placeholder) {
if (HeVAL(entry)) {
- if (SvREADONLY(HeVAL(entry)) && !SvIsCOW(HeVAL(entry))) {
+ if (SvREADONLY(HeVAL(entry))) {
SV* const keysv = hv_iterkeysv(entry);
Perl_croak_nocontext(
"Attempt to delete readonly key '%"SVf"' from a restricted hash",