From 10eda19915a458cbc51b4ae5766c3255a3babb3d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 14 Apr 2025 13:32:47 -0700 Subject: [PATCH] Swap ends for future/stream new Pull in bytecodealliance/wit-bindgen#1271 --- Cargo.lock | 10 +++++----- crates/wasmtime/src/runtime/vm/component/libcalls.rs | 4 ++-- .../component-model-async/future-read.wast | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96c41a29f6..ab6eb70422 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5267,7 +5267,7 @@ dependencies = [ [[package]] name = "wit-bindgen" version = "0.41.0" -source = "git+https://github.com/bytecodealliance/witx-bindgen#8aa2cc2cc132fc812737068068f1722457078191" +source = "git+https://github.com/bytecodealliance/witx-bindgen#ef8647453a7bc5f1c1ec1876fb2d5554214c124d" dependencies = [ "wit-bindgen-rt 0.41.0", "wit-bindgen-rust-macro", @@ -5276,7 +5276,7 @@ dependencies = [ [[package]] name = "wit-bindgen-core" version = "0.41.0" -source = "git+https://github.com/bytecodealliance/witx-bindgen#8aa2cc2cc132fc812737068068f1722457078191" +source = "git+https://github.com/bytecodealliance/witx-bindgen#ef8647453a7bc5f1c1ec1876fb2d5554214c124d" dependencies = [ "anyhow", "heck 0.5.0", @@ -5295,7 +5295,7 @@ dependencies = [ [[package]] name = "wit-bindgen-rt" version = "0.41.0" -source = "git+https://github.com/bytecodealliance/witx-bindgen#8aa2cc2cc132fc812737068068f1722457078191" +source = "git+https://github.com/bytecodealliance/witx-bindgen#ef8647453a7bc5f1c1ec1876fb2d5554214c124d" dependencies = [ "bitflags 2.6.0", "futures", @@ -5305,7 +5305,7 @@ dependencies = [ [[package]] name = "wit-bindgen-rust" version = "0.41.0" -source = "git+https://github.com/bytecodealliance/witx-bindgen#8aa2cc2cc132fc812737068068f1722457078191" +source = "git+https://github.com/bytecodealliance/witx-bindgen#ef8647453a7bc5f1c1ec1876fb2d5554214c124d" dependencies = [ "anyhow", "heck 0.5.0", @@ -5320,7 +5320,7 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" version = "0.41.0" -source = "git+https://github.com/bytecodealliance/witx-bindgen#8aa2cc2cc132fc812737068068f1722457078191" +source = "git+https://github.com/bytecodealliance/witx-bindgen#ef8647453a7bc5f1c1ec1876fb2d5554214c124d" dependencies = [ "anyhow", "prettyplease", diff --git a/crates/wasmtime/src/runtime/vm/component/libcalls.rs b/crates/wasmtime/src/runtime/vm/component/libcalls.rs index bd4405b56d..109a530f4a 100644 --- a/crates/wasmtime/src/runtime/vm/component/libcalls.rs +++ b/crates/wasmtime/src/runtime/vm/component/libcalls.rs @@ -878,8 +878,8 @@ unsafe impl HostResultHasUnwindSentinel for ResourcePair { const SENTINEL: u64 = u64::MAX; fn into_abi(self) -> Self::Abi { - assert!(self.read & (1 << 31) == 0); - (u64::from(self.read) << 32) | u64::from(self.write) + assert!(self.write & (1 << 31) == 0); + (u64::from(self.write) << 32) | u64::from(self.read) } } diff --git a/tests/misc_testsuite/component-model-async/future-read.wast b/tests/misc_testsuite/component-model-async/future-read.wast index 155aada18e..a780ff0dd4 100644 --- a/tests/misc_testsuite/component-model-async/future-read.wast +++ b/tests/misc_testsuite/component-model-async/future-read.wast @@ -39,7 +39,7 @@ (import "" "child-run" (func $child-run (param i32))) (func (export "run") - (call $child-run (i32.wrap_i64 (i64.shr_u (call $new) (i64.const 32)))) + (call $child-run (i32.wrap_i64 (call $new))) ) ) (core instance $i (instantiate $m @@ -91,7 +91,7 @@ (import "" "child-run" (func $child-run (param i32))) (func (export "run") - (call $child-run (i32.wrap_i64 (i64.shr_u (call $new) (i64.const 32)))) + (call $child-run (i32.wrap_i64 (call $new))) ) ) (core instance $i (instantiate $m @@ -147,7 +147,7 @@ (import "" "child-run" (func $child-run (param i32))) (func (export "run") - (call $child-run (i32.wrap_i64 (i64.shr_u (call $new) (i64.const 32)))) + (call $child-run (i32.wrap_i64 (call $new))) ) ) (core instance $i (instantiate $m @@ -207,7 +207,7 @@ (import "" "child-run" (func $child-run (param i32))) (func (export "run") - (call $child-run (i32.wrap_i64 (i64.shr_u (call $new) (i64.const 32)))) + (call $child-run (i32.wrap_i64 (call $new))) ) ) (core instance $i (instantiate $m