diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-08-06 18:19:08 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-11 07:41:26 -0700 |
commit | 0ffdaf1a47312f763d4610e9ec65c24561e957a5 (patch) | |
tree | 8dd34cbc20ebccd72f00c3d3a56670b99b0630cf /hv.c | |
parent | d8b516a1046e5fdab4de366564c3388df9504b5d (diff) | |
download | perl-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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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", |