Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index ca0c67bfe05554ba9957da3b4a892ae2ca67cfd3..99ba3f11fd29d774bf6c609e22c79e97bc4eb54e 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -2035,7 +2035,7 @@ static int BoyerMooreIndexOf(Vector<const schar> subject, |
BoyerMoorePopulateGoodSuffixTable(pattern, start); |
pchar last_char = pattern[m - 1]; |
// Continue search from i. |
- do { |
+ while (idx <= n - m) { |
int j = m - 1; |
schar c; |
while (last_char != (c = subject[idx + j])) { |
@@ -2061,7 +2061,7 @@ static int BoyerMooreIndexOf(Vector<const schar> subject, |
} |
idx += shift; |
} |
- } while (idx <= n - m); |
+ } |
return -1; |
} |