diff options
author | David Mitchell <davem@iabyn.com> | 2012-05-22 10:40:55 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-06-13 13:32:53 +0100 |
commit | 7e1a2c8d3379302594e45d7ac3b09fd4b6477ffc (patch) | |
tree | 5d0e695aeea423523e3c1b4dc5658960f9e28308 /pp_hot.c | |
parent | f067efbfa97c3658b1cf186884f09e38fcee1876 (diff) | |
download | perl-7e1a2c8d3379302594e45d7ac3b09fd4b6477ffc.tar.gz |
pp_match(): clarify intuit parens behaviour
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.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1527,9 +1527,9 @@ yup: /* Confirmed by INTUIT */ 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; |