From 5e8c6c9117c92d4af507344c8178002d1ea7d466 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 20 Jan 2023 12:10:00 -0600 Subject: [PATCH] Fix multi-memory condition when spectest fuzzing (#5609) The check needs to verify that the maximum number of memories is precisely one to ensure that multi-memory is disabled yet modules can still have up to one memory as configured in the pooling allocator. --- crates/fuzzing/src/generators/config.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/fuzzing/src/generators/config.rs b/crates/fuzzing/src/generators/config.rs index f673421ddd..aaf435c013 100644 --- a/crates/fuzzing/src/generators/config.rs +++ b/crates/fuzzing/src/generators/config.rs @@ -116,8 +116,10 @@ impl Config { } // Make sure the runtime limits allow for the instantiation of all spec - // tests. - if config.max_memories < 1 || config.max_tables < 5 { + // tests. Note that the max memories must be precisely one since 0 won't + // instantiate spec tests and more than one is multi-memory which is + // disabled for spec tests. + if config.max_memories != 1 || config.max_tables < 5 { return false; }