Commit 64748980 authored by mmoroz's avatar mmoroz Committed by Commit bot

Add GC request to libFuzzers in attempt to avoid parasitic coverage.

R=aizatsky@chromium.org, jochen@chromium.org, kcc@chromium.org, ochang@chromium.org
BUG=584819
LOG=Y

Review-Url: https://codereview.chromium.org/1927933002
Cr-Commit-Position: refs/heads/master@{#35866}
parent 132c09ed
......@@ -10,6 +10,8 @@
#include "include/libplatform/libplatform.h"
#include "src/flags.h"
namespace v8_fuzzer {
namespace {
......@@ -36,6 +38,7 @@ class FuzzerSupport::ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
};
FuzzerSupport::FuzzerSupport(int* argc, char*** argv) {
v8::internal::FLAG_expose_gc = true;
v8::V8::SetFlagsFromCommandLine(argc, *argv, true);
v8::V8::InitializeICU();
v8::V8::InitializeExternalStartupData((*argv)[0]);
......
......@@ -27,5 +27,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
}
v8::JSON::Parse(support->GetContext(), source).IsEmpty();
isolate->RequestGarbageCollectionForTesting(
v8::Isolate::kFullGarbageCollection);
return 0;
}
......@@ -38,5 +38,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
info.set_global();
v8::internal::Parser parser(&info);
parser.Parse(&info);
isolate->RequestGarbageCollectionForTesting(
v8::Isolate::kFullGarbageCollection);
return 0;
}
......@@ -71,5 +71,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
Test(isolate, regexp, source, results_array);
}
isolate->RequestGarbageCollectionForTesting(
v8::Isolate::kFullGarbageCollection);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment