summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-01-27 06:22:48 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-01-27 06:22:48 +0000
commit41123dfdac2a292c8e128568f2262a373b14c931 (patch)
treeeed73dfeff8498ff05a4d05ef7391e35e8cca6db /regexec.c
parent6bca211d55e34dd0fe117f187e7391adcf28a1a5 (diff)
downloadperl-41123dfdac2a292c8e128568f2262a373b14c931.tar.gz
More documentation for the regexp context stack.
p4raw-id: //depot/perl@8566
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/regexec.c b/regexec.c
index eef5f598dd..c70d1b1655 100644
--- a/regexec.c
+++ b/regexec.c
@@ -147,8 +147,12 @@ S_regcppush(pTHX_ I32 parenfloor)
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 @@ S_regcppop(pTHX)
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;