develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [ID 20010811.006] re_eval: logical leaks

Thread Previous | Thread Next
From:
Hugo van der Sanden
Date:
August 15, 2001 02:34
Subject:
Re: [ID 20010811.006] re_eval: logical leaks
Message ID:
200108150933.f7F9Xnr11222@crypt.compulink.co.uk
I wrote:
:perl -Dr -we '"ab" =~ /^(a(??{"(?!)"})|a(?{1}))b/'
:suggests that 'logical' is not correctly restored on backtracking.

Attached patch on @11663 fixes it. Should also be applicable to 5.6.*.

Hugo
--- regexec.c.old	Sat Aug  4 20:16:00 2001
+++ regexec.c	Wed Aug 15 10:27:21 2001
@@ -2625,6 +2625,7 @@
 		    /* XXXX This is too dramatic a measure... */
 		    PL_reg_maxiter = 0;
 
+		    logical = 0;
 		    sayNO;
 		}
 		sw = SvTRUE(ret);
--- t/op/re_tests.old	Thu May 17 19:32:35 2001
+++ t/op/re_tests	Wed Aug 15 10:26:16 2001
@@ -789,3 +789,4 @@
 (abc)?(abc)+	abc	y	$1:$2	:abc	-
 'b\s^'m	a\nb\n	n	-	-
 \ba	a	y	-	-
+^(a(??{"(?!)"})|(a)(?{1}))b	ab	y	$2	a	# [ID 20010811.006]

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About