[fuzzers] Add hash to regexp-builtins CHECK

The hash avoids assigning all CHECK failures to the same clusterfuzz
report.

Bug: chromium:805970
Change-Id: Ia52da335ea86fbc7cc924dd81a893722a6d3d92e
Reviewed-on: https://chromium-review.googlesource.com/894323
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50992}
This commit is contained in:
jgruber 2018-01-31 13:05:57 +01:00 committed by Commit Bot
parent 0b2edc4097
commit 9222cd55f4

View File

@ -25,6 +25,7 @@ namespace internal {
namespace {
constexpr bool kVerbose = false; // For debugging, verbose error messages.
constexpr uint32_t kRegExpBuiltinsFuzzerHashSeed = 83;
#define REGEXP_BUILTINS(V) \
V(Exec, exec) \
@ -358,7 +359,13 @@ void CompileRunAndVerify(FuzzerArgs* args, const std::string& source) {
return;
}
CHECK(ResultsAreIdentical(args));
if (!ResultsAreIdentical(args)) {
uint32_t hash = StringHasher::HashSequentialString(
args->input_data, static_cast<int>(args->input_length),
kRegExpBuiltinsFuzzerHashSeed);
V8_Fatal(__FILE__, __LINE__,
"!ResultAreIdentical(args); RegExpBuiltinsFuzzerHash=%x", hash);
}
}
void TestRegExpPrototypeExec(FuzzerArgs* args) {