Keep the assert(3) call at the top of the function.
Change-Id: Ie6086c53926f2ecb9dc9901414d151c2314a6bd3
Reviewed-on: https://code-review.googlesource.com/32470
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/util/pcre.cc b/util/pcre.cc
index cd2d6da..78de292 100644
--- a/util/pcre.cc
+++ b/util/pcre.cc
@@ -612,12 +612,12 @@
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)