diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-27 02:31:35 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-27 02:31:35 +0000 |
commit | 09e8ae3b675695eeca309327a14174ff5ec475ce (patch) | |
tree | 0c61ddf0de5f2c046506ae889b8ed4b546bfc834 /regexec.c | |
parent | dafc8851ab778a44213cb74896e93c0f90bed47d (diff) | |
download | perl-09e8ae3b675695eeca309327a14174ff5ec475ce.tar.gz |
The code in regcppop() (see #7878) contains the correct lower
limit for the unused submatch 'cleanup' loop so that under
"use utf8" the following code wouldn't dump core:
"," =~ /([^,]*,)*/ With the the wrong lower limit (>=1)
the cleanup loop in regtry() stomped beyond allocated area
in the startp[] array. Therefore, copied the correct lower
loop limit (*PL_reglastparen) to regtry(). Note: something
may still not be quite right: why was the _higher_ loop limit
(prog->nparens) different in the utf8 case?
After this patch "./perl -Ilib -Mutf8 t/op/regexp.t" works
without core dumps, there were about 17 of them before
the patch (with us since Perl 5.7.0). Two failures, still:
496 and 505 (though these may not be severe).
Patch #7881 is also needed since both the cleanup loops
seem to be needed.
Also, the t/op/pat#44 seems to core dump under utf8.
Plus a couple of failures. UGH-8.
p4raw-id: //depot/perl@7879
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -196,7 +196,7 @@ S_regcppop(pTHX) * 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 */ + * (as of patchlevel 7877) will fail. --jhi */ for (paren = *PL_reglastparen + 1; paren <= PL_regnpar; paren++) { if (paren > PL_regsize) PL_regstartp[paren] = -1; @@ -1810,7 +1810,7 @@ S_regtry(pTHX_ regexp *prog, char *startpos) sp = prog->startp; ep = prog->endp; if (prog->nparens) { - for (i = prog->nparens; i >= 1; i--) { + for (i = prog->nparens; i > *PL_reglastparen; i--) { *++sp = -1; *++ep = -1; } |