summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pad.c5
-rw-r--r--t/op/eval.t8
2 files changed, 7 insertions, 6 deletions
diff --git a/pad.c b/pad.c
index 9b8cda5df2..8ab34ff465 100644
--- a/pad.c
+++ b/pad.c
@@ -1450,11 +1450,6 @@ Perl_pad_free(pTHX_ PADOFFSET po)
if (PL_curpad[po] && PL_curpad[po] != &PL_sv_undef) {
SvPADTMP_off(PL_curpad[po]);
-#ifdef USE_ITHREADS
- /* SV could be a shared hash key (eg bugid #19022) */
- if (!SvIsCOW(PL_curpad[po]))
- SvREADONLY_off(PL_curpad[po]); /* could be a freed constant */
-#endif
}
if ((I32)po < PL_padix)
PL_padix = po - 1;
diff --git a/t/op/eval.t b/t/op/eval.t
index 0a5fadc1e0..a1c1c1a94c 100644
--- a/t/op/eval.t
+++ b/t/op/eval.t
@@ -6,7 +6,7 @@ BEGIN {
require './test.pl';
}
-print "1..107\n";
+print "1..108\n";
eval 'print "ok 1\n";';
@@ -611,3 +611,9 @@ eval $ov;
print "ok\n";
EOP
+for my $k (!0) {
+ eval 'my $do_something_with = $k';
+ eval { $k = 'mon' };
+ is "a" =~ /a/, "1",
+ "string eval leaves readonly lexicals readonly [perl #19135]";
+}