diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-27 02:21:17 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-27 02:21:17 +0000 |
commit | dafc8851ab778a44213cb74896e93c0f90bed47d (patch) | |
tree | c07a4329abe837c3799c445c6640b2b49a95b315 /regexec.c | |
parent | 3dd2943cceaddf3b381783dec225bf45f4c0c4c9 (diff) | |
download | perl-dafc8851ab778a44213cb74896e93c0f90bed47d.tar.gz |
The unused submatch cleanup code in regtry() seems to be more crucial,
the code in regcppop() seems to be redundant for the test suite --
but it contains a germ of truth, and it needed for the build
process itself: see #7879 and #7881.
p4raw-id: //depot/perl@7878
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -190,11 +190,19 @@ S_regcppop(pTHX) (IV)(*PL_reglastparen + 1), (IV)PL_regnpar); } ); +#if 0 + /* It would seem that the similar code in regtry() + * already takes care of this, and in fact it is in + * a better location to since this code can #if 0-ed out + * but the code in regtry() is needed or otherwise tests + * requiring null fields (pat.t#187 and split.t#{13,14} + * (as of 7877) will fail. --jhi */ for (paren = *PL_reglastparen + 1; paren <= PL_regnpar; paren++) { if (paren > PL_regsize) PL_regstartp[paren] = -1; PL_regendp[paren] = -1; } +#endif return input; } @@ -1791,7 +1799,14 @@ S_regtry(pTHX_ regexp *prog, char *startpos) /* XXXX What this code is doing here?!!! There should be no need to do this again and again, PL_reglastparen should take care of this! --ilya*/ - /* Tests pat.t#187 and split.t#{13,14} seem to depend on this. --jhi */ + + /* Tests pat.t#187 and split.t#{13,14} seem to depend on this code. + * Actually, the code in regcppop() (which Ilya may be meaning by + * PL_reglastparen), does not seem to be needed at all (?!), whereas + * this code *is* needed for the above-mentioned tests to succeed. + * The common theme on those tests seems to be returning null fields + * from matches. --jhi */ +#if 1 sp = prog->startp; ep = prog->endp; if (prog->nparens) { @@ -1800,6 +1815,7 @@ S_regtry(pTHX_ regexp *prog, char *startpos) *++ep = -1; } } +#endif REGCP_SET(lastcp); if (regmatch(prog->program + 1)) { prog->endp[0] = PL_reginput - PL_bostr; |