Commit 6056b085 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[inspector][fuzzer] Allow to overwrite the global 'utils'

The auto-generated inspector fuzzer corpus seed files will overwrite the
'utils' class by a proxy which provides non-existing functions.
See https://crrev.com/c/2563552.

R=szuend@chromium.org

Bug: chromium:1142437
Change-Id: If1e86617c4244f1b12fe007b5059b5a5f57454d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2565127Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71515}
parent 975e7e6e
......@@ -40,9 +40,12 @@ class UtilsExtension : public IsolateData::SetupGlobalTask {
v8::Local<v8::ObjectTemplate> utils = v8::ObjectTemplate::New(isolate);
auto Set = [isolate](v8::Local<v8::ObjectTemplate> tmpl, const char* str,
v8::Local<v8::Data> value) {
// Do not set {ReadOnly}, because fuzzer inputs might overwrite individual
// methods, or the whole "utils" global. See the
// `testing/libfuzzer/fuzzers/generate_v8_inspector_fuzzer_corpus.py` file
// in chromium.
tmpl->Set(ToV8String(isolate, str), value,
static_cast<v8::PropertyAttribute>(
v8::PropertyAttribute::ReadOnly |
v8::PropertyAttribute::DontDelete));
};
Set(utils, "quit",
......
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