summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-11-01 10:44:58 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-11-01 10:44:58 +0000
commit581d1b5b4d97adf808d2c062f6d09ceb66f049ae (patch)
treecff54c1bf824e1f2d679d442d3da4770ab73df22 /t
parentb293a5f82b89c42cd48ef477c1be57a87e71d275 (diff)
downloadperl-581d1b5b4d97adf808d2c062f6d09ceb66f049ae.tar.gz
Regression test by Yves Orton for : [perl #36046] Special var @-
becomes arbitrarily large p4raw-id: //depot/perl@29178
Diffstat (limited to 't')
-rwxr-xr-xt/op/pat.t13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/op/pat.t b/t/op/pat.t
index 9bd655312f..3cb8e8f660 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -3839,6 +3839,17 @@ for my $c ("z", "\0", "!", chr(254), chr(256)) {
ok(eval("qq/$targ/ =~ /$reg/"), "\\c\\ in pattern");
}
+{
+ my $str='abc';
+ my $count=0;
+ my $mval=0;
+ my $pval=0;
+ while ($str=~/b/g) { $mval=$#-; $pval=$#+; $count++ }
+ iseq($mval,0,"\@- should be empty [RT#36046]");
+ iseq($pval,0,"\@+ should be empty [RT#36046]");
+ iseq($count,1,"should have matched once only [RT#36046]");
+}
+
# Keep the following tests last -- they may crash perl
ok(("a" x (2**15 - 10)) =~ /^()(a|bb)*$/, "Recursive stack cracker: #24274")
@@ -3849,5 +3860,5 @@ ok((q(a)x 100) =~ /^(??{'(.)'x 100})/,
or print "# Unexpected outcome: should pass or crash perl\n";
# Don't forget to update this!
-BEGIN{print "1..1284\n"};
+BEGIN{print "1..1287\n"};