diff options
-rw-r--r-- | scope.c | 2 | ||||
-rw-r--r-- | t/lib/universal.t | 5 |
2 files changed, 5 insertions, 2 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 */ diff --git a/t/lib/universal.t b/t/lib/universal.t index 55fda06900..d3510c4571 100644 --- a/t/lib/universal.t +++ b/t/lib/universal.t @@ -6,7 +6,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; - plan( tests => 15 ); + plan( tests => 16 ); } for my $arg ('', 'q[]', qw( 1 undef )) { @@ -66,3 +66,6 @@ eval { ${\!0} = 7 }; like $@, qr "^Modification of a read-only value", 'protected values still croak on assignment after SvREADONLY(..., 0)'; is ${\3} == 3, "1", 'attempt to modify failed'; + +eval { { my $x = ${qr//}; Internals::SvREADONLY $x, 1; () } }; +is $@, "", 'read-only lexical regexps on scope exit [perl #115254]'; |