diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-20 06:41:29 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-20 09:25:02 -0700 |
commit | 57c404c9ca0d045fece7cbd7010d0d084cef5821 (patch) | |
tree | 199f036fef41bce517085a382bb6d679047223bc /scope.c | |
parent | f7634e8653b6354fafc3483263dce775dae43ffd (diff) | |
download | perl-57c404c9ca0d045fece7cbd7010d0d084cef5821.tar.gz |
[perl #115254] Fix flag check on scope exit
$ ./perl -Ilib -e '{ my $x = 3; Internals::SvREADONLY $x, 1; () }'
$ ./perl -Ilib -e '{ my $x = ${qr//}; Internals::SvREADONLY $x, 1; () }'
Modification of a read-only value attempted at -e line 1.
The latter causes $x to be marked FAKE. At the time this code was
introduced in scope.c, read-only+fake meant cow, so the !fake check
was necessary. (That said, it has always behaved incorrectly for glob
copies that are also marked fake.)
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -996,7 +996,7 @@ Perl_leave_scope(pTHX_ I32 base) * readonlyness so that it can go out of scope * quietly */ - if (SvREADONLY(sv) && !SvFAKE(sv)) + if (SvREADONLY(sv)) SvREADONLY_off(sv); if (SvOOK(sv)) { /* OOK or HvAUX */ |