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

Re: perl@8531

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
January 26, 2001 22:23
Subject:
Re: perl@8531
Message ID:
20010127002213.Q22333@chaos.wustl.edu
On Tue, Jan 23, 2001 at 05:27:17PM +0000, Hugo wrote:
> In <20010123100029.R8146@chaos.wustl.edu>, Jarkko Hietaniemi writes:
> :____________________________________________________________________________
> :[  8510] By: jhi                                   on 2001/01/21  22:56:53
> :        Log: Document the regex content pushing/popping a bit better.
> :     Branch: perl
> :	   ! regexec.c
> :____________________________________________________________________________
> 
> Should that be 'context'? If so, it might be worth correcting for Changes
> file.

Further tweakage.

==== //depot/perl/regexec.c#150 - /u/vieraat/vieraat/jhi/pp4/perl/regexec.c ====
Index: perl/regexec.c
--- perl/regexec.c.~1~	Sat Jan 27 08:21:16 2001
+++ perl/regexec.c	Sat Jan 27 08:21:16 2001
@@ -147,8 +147,12 @@
     SSPUSHINT(PL_regsize);
     SSPUSHINT(*PL_reglastparen);
     SSPUSHPTR(PL_reginput);
-    SSPUSHINT(paren_elems_to_push + (REGCP_PAREN_ELEMS - 1));
+#define REGCP_FRAME_ELEMS 2
+/* REGCP_FRAME_ELEMS are part of the REGCP_OTHER_ELEMS and
+ * are needed for the regexp context stack bookkeeping. */
+    SSPUSHINT(paren_elems_to_push + REGCP_OTHER_ELEMS - REGCP_FRAME_ELEMS);
     SSPUSHINT(SAVEt_REGCONTEXT); /* Magic cookie. */
+
     return retval;
 }
 
@@ -179,7 +183,8 @@
     PL_regsize = SSPOPINT;
 
     /* Now restore the parentheses context. */
-    for (i -= (REGCP_PAREN_ELEMS - 1); i > 0; i -= REGCP_PAREN_ELEMS) {
+    for (i -= (REGCP_OTHER_ELEMS - REGCP_FRAME_ELEMS);
+	 i > 0; i -= REGCP_PAREN_ELEMS) {
 	paren = (U32)SSPOPINT;
 	PL_reg_start_tmp[paren] = (char *) SSPOPPTR;
 	PL_regstartp[paren] = SSPOPINT;
End of Patch.


-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

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