libregexp: fix match choice bug

This bug fix allows some pathological regular
expressions to cause the regexp library to
report a stack overflow (really a stack filling; safe)
but it also fixes the behavior of some common regexps.
It is too hard to satisfy both.
This commit is contained in:
Russ Cox 2008-01-10 17:06:51 -05:00
parent 79ff7e4b5e
commit 27589754e4
2 changed files with 2 additions and 2 deletions

View file

@ -132,7 +132,7 @@ regexec1(Reprog *progp, /* program to run */
break;
case OR:
/* evaluate right choice later */
if(_renewthread(tl, inst->u1.right, ms, &tlp->se) == tle)
if(_renewthread(tlp, inst->u1.right, ms, &tlp->se) == tle)
return -1;
/* efficiency: advance and re-evaluate */
continue;

View file

@ -125,7 +125,7 @@ rregexec1(Reprog *progp, /* program to run */
break;
case OR:
/* evaluate right choice later */
if(_renewthread(tl, inst->u1.right, ms, &tlp->se) == tle)
if(_renewthread(tlp, inst->u1.right, ms, &tlp->se) == tle)
return -1;
/* efficiency: advance and re-evaluate */
continue;