This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80edda0
)
add comment explaining a subtlety
author
Yves Orton
<demerphq@gmail.com>
Mon, 7 Mar 2016 08:18:33 +0000
(09:18 +0100)
committer
Yves Orton
<demerphq@gmail.com>
Mon, 7 Mar 2016 08:18:35 +0000
(09:18 +0100)
Tony caught a bug I made in
d5a00e4af6b155495be31a35728b8fef8e671ebe
and fixed
it in
2dc40b2d7c20b0d31c4343ac23cda9799f234a65
. This comment explains
the subtlety that lead to the bug: the compilation state var
RExC_npar is +1 as compared to the equivalent rex->nparens.
regcomp.c
patch
|
blob
|
blame
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
916f9ba
..
d0133fe
100644
(file)
--- a/
regcomp.c
+++ b/
regcomp.c
@@
-18214,6
+18214,9
@@
S_reginsert(pTHX_ RExC_state_t *pRExC_state, U8 op, regnode *opnd, U32 depth)
if (RExC_open_parens) {
int paren;
/*DEBUG_PARSE_FMT("inst"," - %"IVdf, (IV)RExC_npar);*/
+ /* remember that RExC_npar is rex->nparens + 1,
+ * iow it is 1 more than the number of parens seen in
+ * the pattern so far. */
for ( paren=0 ; paren < RExC_npar ; paren++ ) {
if ( RExC_open_parens[paren] >= opnd ) {
/*DEBUG_PARSE_FMT("open"," - %d",size);*/