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
* 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;
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;
}