@@ -527,7 +527,7 @@ impl<'a> Arbitrary<'a> for Config {
527527
528528 config
529529 . wasmtime
530- . update_module_config ( & mut config. module_config . config , u) ?;
530+ . update_module_config ( & mut config. module_config , u) ?;
531531
532532 Ok ( config)
533533 }
@@ -604,7 +604,7 @@ impl WasmtimeConfig {
604604 /// too.
605605 pub fn update_module_config (
606606 & mut self ,
607- config : & mut wasm_smith :: Config ,
607+ config : & mut ModuleConfig ,
608608 u : & mut Unstructured < ' _ > ,
609609 ) -> arbitrary:: Result < ( ) > {
610610 match self . compiler_strategy {
@@ -627,10 +627,11 @@ impl WasmtimeConfig {
627627 // at this time, so if winch is selected be sure to disable wasm
628628 // proposals in `Config` to ensure that Winch can compile the
629629 // module that wasm-smith generates.
630- config. relaxed_simd_enabled = false ;
631- config. gc_enabled = false ;
632- config. tail_call_enabled = false ;
633- config. reference_types_enabled = false ;
630+ config. config . relaxed_simd_enabled = false ;
631+ config. config . gc_enabled = false ;
632+ config. config . tail_call_enabled = false ;
633+ config. config . reference_types_enabled = false ;
634+ config. function_references_enabled = false ;
634635
635636 // Winch's SIMD implementations require AVX and AVX2.
636637 if self
@@ -640,7 +641,7 @@ impl WasmtimeConfig {
640641 . codegen_flag ( "has_avx2" )
641642 . is_some_and ( |value| value == "false" )
642643 {
643- config. simd_enabled = false ;
644+ config. config . simd_enabled = false ;
644645 }
645646
646647 // Tuning the following engine options is currently not supported
@@ -651,7 +652,7 @@ impl WasmtimeConfig {
651652 }
652653
653654 CompilerStrategy :: CraneliftPulley => {
654- config. threads_enabled = false ;
655+ config. config . threads_enabled = false ;
655656 }
656657 }
657658
@@ -661,7 +662,8 @@ impl WasmtimeConfig {
661662 // and for wasm threads that will require some refactoring of the
662663 // `LinearMemory` trait to bubble up the request that the linear memory
663664 // not move. Otherwise that just generates a panic right now.
664- if config. threads_enabled || matches ! ( self . strategy, InstanceAllocationStrategy :: Pooling ( _) )
665+ if config. config . threads_enabled
666+ || matches ! ( self . strategy, InstanceAllocationStrategy :: Pooling ( _) )
665667 {
666668 self . avoid_custom_unaligned_memory ( u) ?;
667669 }
@@ -672,31 +674,38 @@ impl WasmtimeConfig {
672674 // If the pooling allocator is used, do not allow shared memory to
673675 // be created. FIXME: see
674676 // https://github.com/bytecodealliance/wasmtime/issues/4244.
675- config. threads_enabled = false ;
677+ config. config . threads_enabled = false ;
676678
677679 // Ensure the pooling allocator can support the maximal size of
678680 // memory, picking the smaller of the two to win.
679681 let min_bytes = config
682+ . config
680683 . max_memory32_bytes
681684 // memory64_bytes is a u128, but since we are taking the min
682685 // we can truncate it down to a u64.
683- . min ( config. max_memory64_bytes . try_into ( ) . unwrap_or ( u64:: MAX ) ) ;
686+ . min (
687+ config
688+ . config
689+ . max_memory64_bytes
690+ . try_into ( )
691+ . unwrap_or ( u64:: MAX ) ,
692+ ) ;
684693 let mut min = min_bytes. min ( pooling. max_memory_size as u64 ) ;
685694 if let MemoryConfig :: Normal ( cfg) = & self . memory_config {
686695 min = min. min ( cfg. memory_reservation . unwrap_or ( 0 ) ) ;
687696 }
688697 pooling. max_memory_size = min as usize ;
689- config. max_memory32_bytes = min;
690- config. max_memory64_bytes = min as u128 ;
698+ config. config . max_memory32_bytes = min;
699+ config. config . max_memory64_bytes = min as u128 ;
691700
692701 // If traps are disallowed then memories must have at least one page
693702 // of memory so if we still are only allowing 0 pages of memory then
694703 // increase that to one here.
695- if config. disallow_traps {
704+ if config. config . disallow_traps {
696705 if pooling. max_memory_size < ( 1 << 16 ) {
697706 pooling. max_memory_size = 1 << 16 ;
698- config. max_memory32_bytes = 1 << 16 ;
699- config. max_memory64_bytes = 1 << 16 ;
707+ config. config . max_memory32_bytes = 1 << 16 ;
708+ config. config . max_memory64_bytes = 1 << 16 ;
700709 if let MemoryConfig :: Normal ( cfg) = & mut self . memory_config {
701710 match & mut cfg. memory_reservation {
702711 Some ( size) => * size = ( * size) . max ( pooling. max_memory_size as u64 ) ,
@@ -712,13 +721,13 @@ impl WasmtimeConfig {
712721
713722 // Don't allow too many linear memories per instance since massive
714723 // virtual mappings can fail to get allocated.
715- config. min_memories = config. min_memories . min ( 10 ) ;
716- config. max_memories = config. max_memories . min ( 10 ) ;
724+ config. config . min_memories = config . config . min_memories . min ( 10 ) ;
725+ config. config . max_memories = config . config . max_memories . min ( 10 ) ;
717726
718727 // Force this pooling allocator to always be able to accommodate the
719728 // module that may be generated.
720- pooling. total_memories = config. max_memories as u32 ;
721- pooling. total_tables = config. max_tables as u32 ;
729+ pooling. total_memories = config. config . max_memories as u32 ;
730+ pooling. total_tables = config. config . max_tables as u32 ;
722731 }
723732
724733 if !self . signals_based_traps {
@@ -728,7 +737,7 @@ impl WasmtimeConfig {
728737 // fixable with some more work on the bounds-checks side of things
729738 // to do a full bounds check even on static memories, but that's
730739 // left for a future PR.
731- config. threads_enabled = false ;
740+ config. config . threads_enabled = false ;
732741
733742 // Spectre-based heap mitigations require signal handlers so this
734743 // must always be disabled if signals-based traps are disabled.
0 commit comments