Commit ae0f505d authored by Jonathan Metzman's avatar Jonathan Metzman Committed by Commit Bot

Reduce time JavaScript is allowed to execute for from 12 to seven seconds

Do this to reduce the likelihood of running out of time before
finishing with the corpus on ClusterFuzz.

TBR=mmoroz@chromium.org

Bug: 791052
Change-Id: I8c91dc0ff3e64dbde9bc6e5b17ef85e456c64911
Reviewed-on: https://chromium-review.googlesource.com/803894Reviewed-by: default avatarJonathan Metzman <metzman@chromium.org>
Reviewed-by: default avatarAbhishek Arya <inferno@chromium.org>
Commit-Queue: Jonathan Metzman <metzman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520965}
parent b3347fc6
...@@ -27,7 +27,7 @@ static const seconds kSleepSeconds(1); ...@@ -27,7 +27,7 @@ static const seconds kSleepSeconds(1);
// kSleepSeconds + kMaxExecutionSeconds. // kSleepSeconds + kMaxExecutionSeconds.
// TODO(metzman): Determine if having such a short timeout causes too much // TODO(metzman): Determine if having such a short timeout causes too much
// indeterminism. // indeterminism.
static const seconds kMaxExecutionSeconds(12); static const seconds kMaxExecutionSeconds(7);
// Inspired by/copied from d8 code, this allocator will return nullptr when // Inspired by/copied from d8 code, this allocator will return nullptr when
// an allocation request is made that puts currently_allocated_ over // an allocation request is made that puts currently_allocated_ over
...@@ -153,11 +153,11 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { ...@@ -153,11 +153,11 @@ extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
} }
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
static Environment* env = new Environment();
if (size < 1) if (size < 1)
return 0; return 0;
static Environment* env = new Environment();
v8::Isolate::Scope isolate_scope(env->isolate); v8::Isolate::Scope isolate_scope(env->isolate);
v8::HandleScope handle_scope(env->isolate); v8::HandleScope handle_scope(env->isolate);
v8::Local<v8::Context> context = v8::Context::New(env->isolate); v8::Local<v8::Context> context = v8::Context::New(env->isolate);
......
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