summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pp.c1
-rwxr-xr-xt/op/pat.t10
2 files changed, 9 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 1b83259622..0a15c746d1 100644
--- a/pp.c
+++ b/pp.c
@@ -4695,6 +4695,7 @@ PP(pp_split)
}
}
s = rx->endp[0] + orig;
+ PUTBACK;
}
}
diff --git a/t/op/pat.t b/t/op/pat.t
index b3f42a8b46..fdc4f9b2a1 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -6,7 +6,7 @@
$| = 1;
-print "1..993\n";
+print "1..994\n";
BEGIN {
chdir 't' if -d 't';
@@ -3139,5 +3139,11 @@ ok("bbbbac" =~ /$pattern/ && $1 eq 'a', "[perl #3547]");
ok("\x{2019}" =~ /\S/, "Markus Kuhn 2003-02-26");
}
-# last test 993
+{
+ my $i;
+ ok('-1-3-5-' eq join('', split /((??{$i++}))/, '-1-3-5-'),
+ "[perl #21411] (??{ .. }) corrupts split's stack")
+}
+
+# last test 994