diff options
Diffstat (limited to 't/re/pat_re_eval.t')
-rw-r--r-- | t/re/pat_re_eval.t | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/t/re/pat_re_eval.t b/t/re/pat_re_eval.t index 061e7e5076..cef15a0fbd 100644 --- a/t/re/pat_re_eval.t +++ b/t/re/pat_re_eval.t @@ -23,7 +23,7 @@ BEGIN { } -plan tests => 463; # Update this when adding/deleting tests. +plan tests => 464; # Update this when adding/deleting tests. run_tests() unless caller; @@ -1041,6 +1041,23 @@ sub run_tests { is($m, 'a', '?pat? with (??{a,b,c})'); } + { + # this code won't actually fail, but it used to fail valgrind, + # so its here just to make sure valgrind doesn't fail again + # While examining the ops of the secret anon sub wrapped around + # the qr//, the pad of the sub was in scope, so cSVOPo_sv + # got the const from the wrong pad. By having lots of $s's + # (aka gvsv(*s), this forces the targs of the consts which have + # been moved to the pad, to have high indices. + + sub { + local our $s = "abc"; + my $qr = qr/^(?{1})$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s$s/; + }->(); + pass("cSVOPo_sv"); + } + + } # End of sub run_tests |