develooper Front page | perl.perl5.porters | Postings from March 2003

Re: Inline::C seems to hang during make test in 5.8.1 vs. [perl #17757]

From:
David Dyck
Date:
March 2, 2003 15:24
Subject:
Re: Inline::C seems to hang during make test in 5.8.1 vs. [perl #17757]
Message ID:
Pine.LNX.4.51.0303021518530.11604@dd.tc.fluke.com


On Sun, 2 Mar 2003 at 14:32 +0100, Andreas J. Koenig <andreas.koenig@anima....:

> >>>>> On Sun, 2 Mar 2003 00:22:30 -0800 (PST), David Dyck <david.dyck@fluke.com> said:
>
>   > Here's a smaller script that assume that Inline::C has
>   > been installed and passes its test with perl 5.8.0, but
>   > fails with todays 5.8.1.
>
> The infinite loop with your example program started with patch 18533
> on the trunk.

If I apply patch 18533 in reverse to regexec.c, then the infinite loop
goes away.  Of course, that breaks the test case that was added
to t/op/subst.t!  (I've only included the regexec.c portion
of patch 18533)

Change 18533 by hv@hv-crypt.org on 2003/01/21 02:15:29

	Subject: Re: [perl #17757] s///g fails when using English & study in 5.8.0
	From: hv@crypt.org
	Date: Thu, 02 Jan 2003 14:33:49 +0000
	Message-Id: <200301021433.h02EXno03562@crypt.compulink.co.uk>

Affected files ...

... //depot/perl/regexec.c#297 edit

Differences ...

==== //depot/perl/regexec.c#297 (text) ====
Index: perl/regexec.c
--- perl/regexec.c#296~18529~	Mon Jan 20 16:44:20 2003
+++ perl/regexec.c	Mon Jan 20 18:15:29 2003
@@ -541,6 +541,9 @@
 			    start_shift + (s - strbeg), end_shift, pp, 0);
 	else
 	    goto fail_finish;
+	/* we may be pointing at the wrong string */
+	if (s && RX_MATCH_COPIED(prog))
+	    s = prog->subbeg + (s - SvPVX(sv));
 	if (data)
 	    *data->scream_olds = s;
     }
@@ -1858,6 +1861,9 @@
 		 : (s = fbm_instr((unsigned char*)HOP3(s, back_min, strend),
 				  (unsigned char*)strend, must,
 				  PL_multiline ? FBMrf_MULTILINE : 0))) ) {
+	    /* we may be pointing at the wrong string */
+	    if ((flags & REXEC_SCREAM) && RX_MATCH_COPIED(prog))
+		s = prog->subbeg + (s - SvPVX(sv));
 	    DEBUG_r( did_match = 1 );
 	    if (HOPc(s, -back_max) > last1) {
 		last1 = HOPc(s, -back_min);
@@ -1944,6 +1950,9 @@
 				   end_shift, &scream_pos, 1); /* last one */
 		if (!last)
 		    last = scream_olds; /* Only one occurrence. */
+		/* we may be pointing at the wrong string */
+		else if (RX_MATCH_COPIED(prog))
+		    s = prog->subbeg + (s - SvPVX(sv));
 	    }
 	    else {
 		STRLEN len;




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