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
This commit is contained in:
parent
5aabf85d7c
commit
59ba35a327
1 changed files with 1 additions and 1 deletions
|
@ -299,7 +299,7 @@ compile(Renode *parsetr, Reprog *reprog, int nl)
|
||||||
sub = 0;
|
sub = 0;
|
||||||
reinst = (Reinst*)(reprog+1);
|
reinst = (Reinst*)(reprog+1);
|
||||||
end = compile1(parsetr, reinst, &sub, nl);
|
end = compile1(parsetr, reinst, &sub, nl);
|
||||||
assert(reinst + reprog->len == end);
|
assert(end <= reinst + reprog->len);
|
||||||
return reinst;
|
return reinst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue