summaryrefslogtreecommitdiff
path: root/sys/src/libregexp
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2017-02-19 00:32:47 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2017-02-19 00:32:47 +0100
commit59ba35a327d9b5a2f08bc877cb18bf6c6f942b8c (patch)
tree31023b66a18ec1f5da0a1b7f85af13b8c37e9815 /sys/src/libregexp
parent5aabf85d7cc3d0bd457b9b67696737411681cc8d (diff)
libregexp: fix assert check for compile1 instruction count
the assert fails for regcompnl(".") as TANY is compiled to one instruction instead of two when nl == 0. its not a problem when we end up with less instructions, so changing the assert condition from == to <= to make sure we didnt overrun the buffer. -- cinap
Diffstat (limited to 'sys/src/libregexp')
-rw-r--r--sys/src/libregexp/regcomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/libregexp/regcomp.c b/sys/src/libregexp/regcomp.c
index 3e3ba6ae5..3bbc26ca9 100644
--- a/sys/src/libregexp/regcomp.c
+++ b/sys/src/libregexp/regcomp.c
@@ -299,7 +299,7 @@ compile(Renode *parsetr, Reprog *reprog, int nl)
sub = 0;
reinst = (Reinst*)(reprog+1);
end = compile1(parsetr, reinst, &sub, nl);
- assert(reinst + reprog->len == end);
+ assert(end <= reinst + reprog->len);
return reinst;
}