fix short circuit match

This commit is contained in:
Kyryl Melekhin
2021-11-26 01:20:57 +00:00
parent 4c5df2212b
commit f783b12300

2
pike.c
View File

@@ -609,7 +609,7 @@ int re_pikevm(rcode *prog, const char *s, const char **subp, int nsubp)
}
matched = nsub;
}
if (sp == _sp || !nlistidx) {
if (sp == _sp || nlistidx == 1) {
for (i = 0, j = i; i < nsubp; i+=2, j++) {
subp[i] = matched->sub[j];
subp[i+1] = matched->sub[nsubp / 2 + j];