Expand the comment on the \p and \P limit. Change-Id: Ib2f359f8ecc4172754a2b02458fc64698e8c1daf Reviewed-on: https://code-review.googlesource.com/18990 Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/re2/fuzzing/re2_fuzzer.cc b/re2/fuzzing/re2_fuzzer.cc index 1da7a1f..e0aa96a 100644 --- a/re2/fuzzing/re2_fuzzer.cc +++ b/re2/fuzzing/re2_fuzzer.cc
@@ -60,6 +60,11 @@ return 0; // Crudely limit the use of \p and \P. + // Otherwise, we will waste time on inputs that have long runs of Unicode + // character classes. The fuzzer has shown itself to be easily capable of + // generating such patterns that fall within the other limits, but result + // in timeouts nonetheless. The marginal cost is high - even more so when + // counted repetition is involved - whereas the marginal benefit is zero. int backslash_p = 0; for (size_t i = 0; i < size; i++) { if (data[i] == '\\' && i+1 < size && (data[i+1] == 'p' || data[i+1] == 'P'))