*
**** Alterations to Henry's code are...
****
- **** Copyright (c) 1991-2003, Larry Wall
+ **** Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ **** 2000, 2001, 2002, 2003, by Larry Wall and others
****
**** You may distribute under the terms of either the GNU General Public
**** License or the Artistic License, as specified in the README file.
Perl_croak(aTHX_ "panic: paren_elems_to_push < 0");
#define REGCP_OTHER_ELEMS 6
- SSCHECK(paren_elems_to_push + REGCP_OTHER_ELEMS);
+ SSGROW(paren_elems_to_push + REGCP_OTHER_ELEMS);
for (p = PL_regsize; p > parenfloor; p--) {
/* REGCP_PARENS_ELEMS are pushed per pairs of parentheses. */
SSPUSHINT(PL_regendp[p]);
COP *ocurcop = PL_curcop;
PAD *old_comppad;
SV *ret;
+ struct regexp *oreg = PL_reg_re;
n = ARG(scan);
PL_op = (OP_4tree*)PL_regdata->data[n];
sw = SvTRUE(ret);
logical = 0;
}
- else
+ else {
sv_setsv(save_scalar(PL_replgv), ret);
+ cache_re(oreg);
+ }
break;
}
case OPEN:
{
I32 l = 0;
CHECKPOINT lastcp;
+ I32 lparen = *PL_reglastparen;
/* We suppose that the next guy does not need
backtracking: in particular, it is of constant length,
}
if (regmatch(next))
sayYES;
+ /* t/op/regexp.t test 885 fails if this is performed */
+ /* *PL_reglastparen = lparen; */
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- move forward. */
}
if (regmatch(next))
sayYES;
+ *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- back up. */
PL_reginput = locinput;
if (minmod) {
CHECKPOINT lastcp;
+ I32 lparen = *PL_reglastparen;
minmod = 0;
if (ln && regrepeat(scan, ln) < ln)
sayNO;
if (c == (UV)c1 || c == (UV)c2)
{
TRYPAREN(paren, ln, PL_reginput);
+ *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
}
else if (c1 == -1000)
{
TRYPAREN(paren, ln, PL_reginput);
+ *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- move forward. */
}
else {
CHECKPOINT lastcp;
+ I32 lparen = *PL_reglastparen;
n = regrepeat(scan, n);
locinput = PL_reginput;
if (ln < n && PL_regkind[(U8)OP(next)] == EOL &&
if (c1 == -1000 || c == (UV)c1 || c == (UV)c2)
{
TRYPAREN(paren, n, PL_reginput);
+ *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- back up. */
if (c1 == -1000 || c == (UV)c1 || c == (UV)c2)
{
TRYPAREN(paren, n, PL_reginput);
+ *PL_reglastparen = lparen;
REGCP_UNWIND(lastcp);
}
/* Couldn't or didn't -- back up. */