Skip to content

Commit ec56282

Browse files
authored
[rust] align future read buffer (#1247)
We were already aligning the write buffer, but forgot to align the read one as well. Fixes bytecodealliance/wasip3-prototyping#83 Signed-off-by: Joel Dice <[email protected]>
1 parent e8a3745 commit ec56282

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/rust/src/interface.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ pub mod vtable{ordinal} {{
574574
575575
fn read(future: u32) -> ::core::pin::Pin<{box_}<dyn ::core::future::Future<Output = ::std::option::Option<::std::result::Result<{name}, {async_support}::ErrorContext>>>>> {{
576576
{box_}::pin(async move {{
577+
#[repr(align({align}))]
577578
struct Buffer([::core::mem::MaybeUninit::<u8>; {size}]);
578579
let mut buffer = Buffer([::core::mem::MaybeUninit::uninit(); {size}]);
579580
let address = buffer.0.as_mut_ptr() as *mut u8;

0 commit comments

Comments
 (0)