@@ -522,7 +522,7 @@ impl<'a> Arbitrary<'a> for Config {
522522
523523 config
524524 . wasmtime
525- . update_module_config ( & mut config. module_config . config , u) ?;
525+ . update_module_config ( & mut config. module_config , u) ?;
526526
527527 Ok ( config)
528528 }
@@ -599,7 +599,7 @@ impl WasmtimeConfig {
599599 /// too.
600600 pub fn update_module_config (
601601 & mut self ,
602- config : & mut wasm_smith :: Config ,
602+ config : & mut ModuleConfig ,
603603 u : & mut Unstructured < ' _ > ,
604604 ) -> arbitrary:: Result < ( ) > {
605605 match self . compiler_strategy {
@@ -622,10 +622,11 @@ impl WasmtimeConfig {
622622 // at this time, so if winch is selected be sure to disable wasm
623623 // proposals in `Config` to ensure that Winch can compile the
624624 // module that wasm-smith generates.
625- config. relaxed_simd_enabled = false ;
626- config. gc_enabled = false ;
627- config. tail_call_enabled = false ;
628- config. reference_types_enabled = false ;
625+ config. config . relaxed_simd_enabled = false ;
626+ config. config . gc_enabled = false ;
627+ config. config . tail_call_enabled = false ;
628+ config. config . reference_types_enabled = false ;
629+ config. function_references_enabled = false ;
629630
630631 // Winch's SIMD implementations require AVX and AVX2.
631632 if self
@@ -635,7 +636,7 @@ impl WasmtimeConfig {
635636 . codegen_flag ( "has_avx2" )
636637 . is_some_and ( |value| value == "false" )
637638 {
638- config. simd_enabled = false ;
639+ config. config . simd_enabled = false ;
639640 }
640641
641642 // Tuning the following engine options is currently not supported
@@ -646,7 +647,7 @@ impl WasmtimeConfig {
646647 }
647648
648649 CompilerStrategy :: CraneliftPulley => {
649- config. threads_enabled = false ;
650+ config. config . threads_enabled = false ;
650651 }
651652 }
652653
@@ -656,7 +657,8 @@ impl WasmtimeConfig {
656657 // and for wasm threads that will require some refactoring of the
657658 // `LinearMemory` trait to bubble up the request that the linear memory
658659 // not move. Otherwise that just generates a panic right now.
659- if config. threads_enabled || matches ! ( self . strategy, InstanceAllocationStrategy :: Pooling ( _) )
660+ if config. config . threads_enabled
661+ || matches ! ( self . strategy, InstanceAllocationStrategy :: Pooling ( _) )
660662 {
661663 self . avoid_custom_unaligned_memory ( u) ?;
662664 }
@@ -667,31 +669,38 @@ impl WasmtimeConfig {
667669 // If the pooling allocator is used, do not allow shared memory to
668670 // be created. FIXME: see
669671 // https://github.com/bytecodealliance/wasmtime/issues/4244.
670- config. threads_enabled = false ;
672+ config. config . threads_enabled = false ;
671673
672674 // Ensure the pooling allocator can support the maximal size of
673675 // memory, picking the smaller of the two to win.
674676 let min_bytes = config
677+ . config
675678 . max_memory32_bytes
676679 // memory64_bytes is a u128, but since we are taking the min
677680 // we can truncate it down to a u64.
678- . min ( config. max_memory64_bytes . try_into ( ) . unwrap_or ( u64:: MAX ) ) ;
681+ . min (
682+ config
683+ . config
684+ . max_memory64_bytes
685+ . try_into ( )
686+ . unwrap_or ( u64:: MAX ) ,
687+ ) ;
679688 let mut min = min_bytes. min ( pooling. max_memory_size as u64 ) ;
680689 if let MemoryConfig :: Normal ( cfg) = & self . memory_config {
681690 min = min. min ( cfg. memory_reservation . unwrap_or ( 0 ) ) ;
682691 }
683692 pooling. max_memory_size = min as usize ;
684- config. max_memory32_bytes = min;
685- config. max_memory64_bytes = min as u128 ;
693+ config. config . max_memory32_bytes = min;
694+ config. config . max_memory64_bytes = min as u128 ;
686695
687696 // If traps are disallowed then memories must have at least one page
688697 // of memory so if we still are only allowing 0 pages of memory then
689698 // increase that to one here.
690- if config. disallow_traps {
699+ if config. config . disallow_traps {
691700 if pooling. max_memory_size < ( 1 << 16 ) {
692701 pooling. max_memory_size = 1 << 16 ;
693- config. max_memory32_bytes = 1 << 16 ;
694- config. max_memory64_bytes = 1 << 16 ;
702+ config. config . max_memory32_bytes = 1 << 16 ;
703+ config. config . max_memory64_bytes = 1 << 16 ;
695704 if let MemoryConfig :: Normal ( cfg) = & mut self . memory_config {
696705 match & mut cfg. memory_reservation {
697706 Some ( size) => * size = ( * size) . max ( pooling. max_memory_size as u64 ) ,
@@ -707,13 +716,13 @@ impl WasmtimeConfig {
707716
708717 // Don't allow too many linear memories per instance since massive
709718 // virtual mappings can fail to get allocated.
710- config. min_memories = config. min_memories . min ( 10 ) ;
711- config. max_memories = config. max_memories . min ( 10 ) ;
719+ config. config . min_memories = config . config . min_memories . min ( 10 ) ;
720+ config. config . max_memories = config . config . max_memories . min ( 10 ) ;
712721
713722 // Force this pooling allocator to always be able to accommodate the
714723 // module that may be generated.
715- pooling. total_memories = config. max_memories as u32 ;
716- pooling. total_tables = config. max_tables as u32 ;
724+ pooling. total_memories = config. config . max_memories as u32 ;
725+ pooling. total_tables = config. config . max_tables as u32 ;
717726 }
718727
719728 if !self . signals_based_traps {
@@ -723,7 +732,7 @@ impl WasmtimeConfig {
723732 // fixable with some more work on the bounds-checks side of things
724733 // to do a full bounds check even on static memories, but that's
725734 // left for a future PR.
726- config. threads_enabled = false ;
735+ config. config . threads_enabled = false ;
727736
728737 // Spectre-based heap mitigations require signal handlers so this
729738 // must always be disabled if signals-based traps are disabled.
0 commit comments