diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-08-06 13:05:20 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-11 07:41:26 -0700 |
commit | d8b516a1046e5fdab4de366564c3388df9504b5d (patch) | |
tree | 55df660277d38fccfb3c63ce175a999b119f144d /doop.c | |
parent | e811af66c955bc63db487a23e734136b67380030 (diff) | |
download | perl-d8b516a1046e5fdab4de366564c3388df9504b5d.tar.gz |
Make tr/a/b/ croak on read-only null COWs
$ ./perl -Ilib -e 'use constant nullrocow => (keys%{{""=>undef}})[0]; for(nullrocow) { y/a/b/ }'
$ ./perl -Ilib -e 'use constant nullro => ""; for(nullro) { y/a/b/ }'
Modification of a read-only value attempted at -e line 1.
It should croak on COW scalars that are read-only, even if they are
zero-length, just as it does on non-COW scalars.
This logic is left over from when READONLY+FAKE meant COW.
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 1 |
1 files changed, 0 insertions, 1 deletions
@@ -632,7 +632,6 @@ Perl_do_trans(pTHX_ SV *sv) PERL_ARGS_ASSERT_DO_TRANS; if (SvREADONLY(sv) && !(PL_op->op_private & OPpTRANS_IDENTICAL)) { - if (!SvIsCOW(sv)) Perl_croak_no_modify(); } (void)SvPV_const(sv, len); |