Skip to content

Commit

Permalink
Make the fuzzer exercise ToString().
Browse files Browse the repository at this point in the history
Change-Id: If018fc61a145cf6ecf5e1990f99f251911849a52
Reviewed-on: https://code-review.googlesource.com/c/re2/+/61491
Reviewed-by: Alex Chernyakhovsky <[email protected]>
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed Jul 3, 2023
1 parent 2d39b70 commit 1c1ffbe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions re2/fuzzing/re2_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ void TestOneInput(absl::string_view pattern, const RE2::Options& options,
dummy += re.NamedCapturingGroups().size();
dummy += re.CapturingGroupNames().size();
dummy += RE2::QuoteMeta(pattern).size();
dummy += re.Regexp()->ToString().size();

RE2::Set set(options, anchor);
int index = set.Add(pattern, /*error=*/NULL); // -1 on error
Expand Down

0 comments on commit 1c1ffbe

Please sign in to comment.