diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-07-28 13:19:33 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-07-28 13:19:33 -0700 |
commit | ba36554e02872e48d146177a57a9cfb154727fae (patch) | |
tree | 4b9877f12763e5fe851a174299b625a6c834fc65 /op.c | |
parent | f99a5f08f203af84430e677e25df49557c55c24f (diff) | |
download | perl-ba36554e02872e48d146177a57a9cfb154727fae.tar.gz |
[perl #119043] Exempt shared hash key consts from ro
Commit 19130678b4 stopped copy-on-write scalars from being exempt from
readonliness in ck_svconst (called for every OP_CONST). That was for
the sake of consistency.
It turns out this breaks CPAN modules, so change it back, but only for
shared hash key scalars, not other COW scalars.
This is an historical artefact left over from when copy-on-write used
the read-only flag without the scalar actually being read-only.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -10568,7 +10568,9 @@ Perl_ck_svconst(pTHX_ OP *o) { PERL_ARGS_ASSERT_CK_SVCONST; PERL_UNUSED_CONTEXT; - SvREADONLY_on(cSVOPo->op_sv); + /* For historical reasons, shared hash scalars are not made read-only. + */ + if (!SvIsCOW_shared_hash(cSVOPo->op_sv)) SvREADONLY_on(cSVOPo->op_sv); return o; } |