Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Update upstream wasm spec test suite submodule (#11926)

Alex Crichtonc2cfaa7ab51c
diff --git a/ci/miri-wast.sh b/ci/miri-wast.sh
index 12929314b7..156fe6a642 100755
--- a/ci/miri-wast.sh
+++ b/ci/miri-wast.sh
@@ -19,8 +19,10 @@ cargo run -- wast --target pulley64 --precompile-save ./miri-wast "$@" \
-O memory-reservation=$((1 << 20)) \
-O memory-guard-size=0 \
-O signals-based-traps=n \
- -O memory-init-cow=n
+ -O memory-init-cow=n \
+ -W function-references,gc
MIRIFLAGS="$MIRIFLAGS -Zmiri-disable-isolation -Zmiri-permissive-provenance" \
cargo miri run -- wast -Ccache=n --target pulley64 --precompile-load ./miri-wast "$@" \
- -O memory-init-cow=n
+ -O memory-init-cow=n \
+ -W function-references,gc
diff --git a/crates/fuzzing/src/generators/config.rs b/crates/fuzzing/src/generators/config.rs
index 6f70915721..9a8779cdc2 100644
--- a/crates/fuzzing/src/generators/config.rs
+++ b/crates/fuzzing/src/generators/config.rs
@@ -142,6 +142,7 @@ impl Config {
simd,
exceptions,
legacy_exceptions: _,
+ custom_descriptors: _,
hogs_memory: _,
nan_canonicalization: _,
diff --git a/crates/test-util/src/wasmtime_wast.rs b/crates/test-util/src/wasmtime_wast.rs
index feec31e214..d348e90c39 100644
--- a/crates/test-util/src/wasmtime_wast.rs
+++ b/crates/test-util/src/wasmtime_wast.rs
@@ -47,6 +47,7 @@ pub fn apply_test_config(config: &mut Config, test_config: &wast::TestConfig) {
exceptions,
legacy_exceptions,
stack_switching,
+ custom_descriptors,
hogs_memory: _,
gc_types: _,
@@ -85,6 +86,9 @@ pub fn apply_test_config(config: &mut Config, test_config: &wast::TestConfig) {
let exceptions = stack_switching || exceptions.unwrap_or(false);
+ // Not implemented in Wasmtime yet.
+ let _custom_descriptors = custom_descriptors.unwrap_or(false);
+
config
.wasm_multi_memory(multi_memory)
.wasm_threads(threads)
diff --git a/crates/test-util/src/wast.rs b/crates/test-util/src/wast.rs
index f98ddfee33..f03003268e 100644
--- a/crates/test-util/src/wast.rs
+++ b/crates/test-util/src/wast.rs
@@ -104,9 +104,6 @@ fn spec_test_config(test: &Path) -> TestConfig {
ret.threads = Some(true);
ret.reference_types = Some(false);
}
- Some("relaxed-simd") => {
- ret.relaxed_simd = Some(true);
- }
Some("custom-page-sizes") => {
ret.custom_page_sizes = Some(true);
ret.multi_memory = Some(true);
@@ -118,10 +115,13 @@ fn spec_test_config(test: &Path) -> TestConfig {
ret.hogs_memory = Some(true);
}
}
- Some("annotations") => {
- ret.simd = Some(true);
+ Some("custom-descriptors") => {
+ ret.custom_descriptors = Some(true);
}
- Some("wasm-3.0") => {
+ Some(proposal) => panic!("unsupported proposal {proposal:?}"),
+ None => {
+ ret.reference_types = Some(true);
+ ret.simd = Some(true);
ret.simd = Some(true);
ret.relaxed_simd = Some(true);
ret.multi_memory = Some(true);
@@ -147,15 +147,11 @@ fn spec_test_config(test: &Path) -> TestConfig {
if test.ends_with("memory.wast")
|| test.ends_with("table.wast")
|| test.ends_with("memory64.wast")
+ || test.ends_with("table64.wast")
{
ret.hogs_memory = Some(true);
}
}
- Some(proposal) => panic!("unsupported proposal {proposal:?}"),
- None => {
- ret.reference_types = Some(true);
- ret.simd = Some(true);
- }
}
ret
@@ -241,6 +237,7 @@ macro_rules! foreach_config_option {
legacy_exceptions
stack_switching
spec_test
+ custom_descriptors
}
};
}
@@ -676,6 +673,17 @@ impl WastTest {
return true;
}
+ // Not implemented in Wasmtime anywhere yet.
+ if self.config.custom_descriptors() {
+ let happens_to_work =
+ ["spec_testsuite/proposals/custom-descriptors/binary-leb128.wast"];
+
+ if happens_to_work.iter().any(|part| self.path.ends_with(part)) {
+ return false;
+ }
+ return true;
+ }
+
false
}
}
diff --git a/crates/wasmtime/src/runtime/vm/vmcontext.rs b/crates/wasmtime/src/runtime/vm/vmcontext.rs
index ef714422d6..61cbba81c7 100644
--- a/crates/wasmtime/src/runtime/vm/vmcontext.rs
+++ b/crates/wasmtime/src/runtime/vm/vmcontext.rs
@@ -1671,7 +1671,8 @@ impl ValRaw {
/// Gets the WebAssembly `funcref` value
#[inline]
pub fn get_funcref(&self) -> *mut c_void {
- unsafe { self.funcref.map_addr(|i| usize::from_le(i)) }
+ let addr = unsafe { usize::from_le(self.funcref.addr()) };
+ core::ptr::with_exposed_provenance_mut(addr)
}
/// Gets the WebAssembly `externref` value
diff --git a/crates/wast/src/wast.rs b/crates/wast/src/wast.rs
index 04099ab85f..83b834583d 100644
--- a/crates/wast/src/wast.rs
+++ b/crates/wast/src/wast.rs
@@ -733,7 +733,7 @@ impl WastContext {
Err(e) => e,
};
let error_message = format!("{err:?}");
- if !error_message.contains(&text[..]) {
+ if !is_matching_assert_invalid_error_message(filename, &text, &error_message) {
bail!("assert_unlinkable: expected {text}, got {error_message}",)
}
}
diff --git a/tests/spec_testsuite b/tests/spec_testsuite
index f50a6621db..7b59001394 160000
--- a/tests/spec_testsuite
+++ b/tests/spec_testsuite
@@ -1 +1 @@
-Subproject commit f50a6621db90a94e9284b903a5adac4ac3aa076b
+Subproject commit 7b59001394c1d9c073ffa3c419df0bd52474bc6d