From 767de83bb7e4bfe3a2d8aec0ec79f9f1f66da30a Mon Sep 17 00:00:00 2001 From: Paul Wankadia Date: Thu, 30 Aug 2018 10:34:51 -0700 Subject: [PATCH] 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 --- util/pcre.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/pcre.cc b/util/pcre.cc index cd2d6da1e..78de2928f 100644 --- a/util/pcre.cc +++ b/util/pcre.cc @@ -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)