summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-20 06:41:29 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-20 09:25:02 -0700
commit57c404c9ca0d045fece7cbd7010d0d084cef5821 (patch)
tree199f036fef41bce517085a382bb6d679047223bc /scope.c
parentf7634e8653b6354fafc3483263dce775dae43ffd (diff)
downloadperl-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scope.c b/scope.c
index cf656c0b0f..5eb9ddb96a 100644
--- a/scope.c
+++ b/scope.c
@@ -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 */