diff --git a/crates/wasi-common/src/snapshots/preview_1.rs b/crates/wasi-common/src/snapshots/preview_1.rs index 4776cb10c268..0f1377cbf9e6 100644 --- a/crates/wasi-common/src/snapshots/preview_1.rs +++ b/crates/wasi-common/src/snapshots/preview_1.rs @@ -351,16 +351,12 @@ impl wasi_snapshot_preview1::WasiSnapshotPreview1 for WasiCtx { let f = self.table().get_file(u32::from(fd))?; let f = f.get_cap(FileCaps::WRITE)?; - let guest_slices: Vec> = ciovs + let guest_slices: Vec> = ciovs .iter() .map(|iov_ptr| { let iov_ptr = iov_ptr?; let iov: types::Ciovec = iov_ptr.read()?; - Ok(iov - .buf - .as_array(iov.buf_len) - .as_slice()? - .expect("cannot use with shared memories; see https://github.com/bytecodealliance/wasmtime/issues/5235 (TODO)")) + Ok(iov.buf.as_array(iov.buf_len).to_vec()?) }) .collect::>()?;