Make atheris load multiple tokens files (#2382)

This commit is contained in:
Dominik Maier 2024-07-12 12:46:42 +02:00 committed by GitHub
parent 081c218737
commit fa4241f4f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -176,11 +176,11 @@ pub extern "C" fn LLVMFuzzerRunDriver(
});
// Create a dictionary if not existing
if state.metadata_map().get::<Tokens>().is_none() {
for tokens_file in &token_files {
state.add_metadata(Tokens::from_file(tokens_file)?);
}
}
state.metadata_or_insert_with(|| {
Tokens::new()
.add_from_files(&token_files)
.expect("Could not read tokens files.")
});
// A minimization+queue policy to get testcasess from the corpus
let scheduler =