Change spectest fuzzing to throw out some fuzz inputs (#5597)

A fuzz bug came in last night from #5567 where spectest fuzzing will
first generate a config, possibly with SSE features for SIMD disabled,
only to have SIMD later enabled by `set_spectest_compliant`. This commit
fixes the issue by changing to `is_spectest_compliant` as a query and
throwing out the fuzz case if it isn't. This means that the spectest
fuzzer will throw out more inputs but means we can continue to generate
interesting configs and such for other inputs.
This commit is contained in:
Alex Crichton
2023-01-19 12:48:45 -06:00
committed by GitHub
parent a2e9a608c1
commit 1f534c5799
2 changed files with 41 additions and 25 deletions

View File

@@ -501,9 +501,11 @@ pub fn make_api_calls(api: generators::api::ApiCalls) {
/// Executes the wast `test` spectest with the `config` specified.
///
/// Ensures that spec tests pass regardless of the `Config`.
pub fn spectest(mut fuzz_config: generators::Config, test: generators::SpecTest) {
pub fn spectest(fuzz_config: generators::Config, test: generators::SpecTest) {
crate::init_fuzzing();
fuzz_config.set_spectest_compliant();
if !fuzz_config.is_spectest_compliant() {
return;
}
log::debug!("running {:?}", test.file);
let mut wast_context = WastContext::new(fuzz_config.to_store());
wast_context.register_spectest(false).unwrap();