Re: [perl #21411] [fix] Postponed RE with split()
authorAdrian M. Enache <enache@rdslink.ro>
Sun, 2 Mar 2003 10:11:27 +0000 (12:11 +0200)
committerhv <hv@crypt.org>
Sun, 2 Mar 2003 16:29:28 +0000 (16:29 +0000)
Message-ID: <20030302081127.GA10782@ratsnest.hole>

p4raw-id: //depot/perl@18805

pp.c
t/op/pat.t

diff --git a/pp.c b/pp.c
index 1b83259..0a15c74 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -4695,6 +4695,7 @@ PP(pp_split)
                }
            }
            s = rx->endp[0] + orig;
+           PUTBACK;
        }
     }
 
index b3f42a8..fdc4f9b 100755 (executable)
@@ -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