There was some dodgy code, (flagged by dmq), that as well
as setting RX_LASTPAREN(rx), RX_LASTCLOSEPAREN(rx) to zero,
also set RX_NPARENS(rx) to zero.
The actual logic is that if we reach that point, the pattern shouldn't
have any capturing parentheses, so instead of assigning zero to it, assert
that RX_NPARENS(rx) is zero.
RX_OFFS(rx)[0].start = s - truebase;
RX_OFFS(rx)[0].end = s - truebase + RX_MINLENRET(rx);
}
- /* including RX_NPARENS(rx) in the below code seems highly suspicious.
- -dmq */
- RX_NPARENS(rx) = RX_LASTPAREN(rx) = RX_LASTCLOSEPAREN(rx) = 0; /* used by @-, @+, and $^N */
+ /* match via INTUIT shouldn't have any captures. Let @-, @+, $^N know */
+ assert(!RX_NPARENS(rx));
+ RX_LASTPAREN(rx) = RX_LASTCLOSEPAREN(rx) = 0;
LEAVE_SCOPE(oldsave);
RETPUSHYES;