diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2007-04-01 00:27:02 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2007-04-01 00:27:02 +0000 |
commit | 19b95bf092bc6fdb9455fe107fc46111b0a1ec31 (patch) | |
tree | c0a2f69a85c98404ef64097caac0800dfe686308 /t/op/pat.t | |
parent | 9bd878171021311bd025e403714388c68ff5d9e2 (diff) | |
download | perl-19b95bf092bc6fdb9455fe107fc46111b0a1ec31.tar.gz |
fix $^R scoping bug.
By setting the outer saved $^R to the current $^R just at the
end of a successful match, and ensuring that that the savestack
doesn't get popped beforehand, the code is simplified and fixes a
bug.
p4raw-id: //depot/perl@30818
Diffstat (limited to 't/op/pat.t')
-rwxr-xr-x | t/op/pat.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/pat.t b/t/op/pat.t index 71ddbe9e8f..6d3cafd62d 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -4127,6 +4127,16 @@ for my $c ("z", "\0", "!", chr(254), chr(256)) { iseq($^R,'last regexp code result'); } iseq($^R,'Nothing'); + + { + local $^R = "Bad"; + ok('x foofoo y' =~ m{ + (foo|bar)\1 # this time without the + + (?{"last regexp code result"}) + }x); + iseq($^R,'last regexp code result'); + } + iseq($^R,'Nothing'); } { local $Message="RT#22395"; @@ -4405,7 +4415,7 @@ ok($@=~/\QSequence \k... not terminated in regex;\E/); iseq(0+$::test,$::TestCount,"Got the right number of tests!"); # Don't forget to update this! BEGIN { - $::TestCount = 1655; + $::TestCount = 1658; print "1..$::TestCount\n"; } |