MCPcopy Create free account
hub / github.com/nodejs/node / loadFlags

Method loadFlags

deps/v8/tools/clusterfuzz/js_fuzzer/corpus.js:240–259  ·  view source on GitHub ↗
(relPath, data)

Source from the content-addressed store, hash-verified

238 }
239
240 loadFlags(relPath, data) {
241 // Create the settings path based on the location of the test file, e.g.
242 // .../fuzzilli/fuzzdir-1/settings.json for
243 // .../fuzzilli/fuzzdir-1/corpus/program_x.js
244 const pathComponents = relPath.split(path.sep);
245 assert(pathComponents.length > 1);
246 assert(pathComponents[0] == 'fuzzilli');
247 const settingsPath = path.join(
248 this.inputDir, pathComponents[0], pathComponents[1], 'settings.json');
249
250 // Use cached flags if already loaded.
251 let flags = this.flagMap.get(settingsPath);
252 if (flags == undefined) {
253 assert(fs.existsSync(settingsPath));
254 const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
255 flags = settings["processArguments"];
256 this.flagMap.set(settingsPath, flags);
257 }
258 return flags;
259 }
260
261 // Fuzzilli is able to load resources relative to the V8 corpus, which is
262 // expected to be side-by-side.

Callers

nothing calls this directly

Calls 8

getMethod · 0.65
parseMethod · 0.65
assertFunction · 0.50
splitMethod · 0.45
joinMethod · 0.45
existsSyncMethod · 0.45
readFileSyncMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected