Skip to content

Commit

Permalink
Keep the assert(3) call at the top of the function.
Browse files Browse the repository at this point in the history
Change-Id: Ie6086c53926f2ecb9dc9901414d151c2314a6bd3
Reviewed-on: https://code-review.googlesource.com/32470
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed Aug 30, 2018
1 parent d499a52 commit 767de83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/pcre.cc
Original file line number Diff line number Diff line change
Expand Up @@ -612,12 +612,12 @@ bool PCRE::DoMatchImpl(const StringPiece& text,
int n,
int* vec,
int vecsize) const {
assert((1 + n) * 3 <= vecsize); // results + PCRE workspace
if (NumberOfCapturingGroups() < n) {
// RE has fewer capturing groups than number of Arg pointers passed in.
return false;
}

assert((1 + n) * 3 <= vecsize); // results + PCRE workspace
int matches = TryMatch(text, 0, anchor, true, vec, vecsize);
assert(matches >= 0); // TryMatch never returns negatives
if (matches == 0)
Expand Down

0 comments on commit 767de83

Please sign in to comment.