plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit 27589754e47a2d2e682ee29daa2d21dff99e509d
parent 79ff7e4b5e5c157aa1347152752eb7c2903ecaca
Author: Russ Cox <rsc@swtch.com>
Date:   Thu, 10 Jan 2008 17:06:51 -0500

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.

Diffstat:
Msrc/libregexp/regexec.c | 2+-
Msrc/libregexp/rregexec.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libregexp/regexec.c b/src/libregexp/regexec.c @@ -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; diff --git a/src/libregexp/rregexec.c b/src/libregexp/rregexec.c @@ -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;