Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 58bc57c

Browse files
dicejlukewagner
andcommitted
fix another stream/future ABI spec discrepancy
This fixes another case where we weren't returning the correct status for closed futures and streams. Thanks to Luke for the updated test case. Fixes #161 Co-authored-by: Luke Wagner <mail@lukewagner.name> Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent ac09ef4 commit 58bc57c

3 files changed

Lines changed: 251 additions & 101 deletions

File tree

crates/wasmtime/src/runtime/component/concurrent.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,15 @@ enum Event {
157157
},
158158
StreamRead {
159159
code: ReturnCode,
160-
handle: u32,
161-
ty: TypeStreamTableIndex,
160+
pending: Option<(TypeStreamTableIndex, u32)>,
162161
},
163162
StreamWrite {
164163
code: ReturnCode,
165164
pending: Option<(TypeStreamTableIndex, u32)>,
166165
},
167166
FutureRead {
168167
code: ReturnCode,
169-
handle: u32,
170-
ty: TypeFutureTableIndex,
168+
pending: Option<(TypeFutureTableIndex, u32)>,
171169
},
172170
FutureWrite {
173171
code: ReturnCode,
@@ -4291,7 +4289,10 @@ impl Waitable {
42914289
/// the state of the stream or future.
42924290
fn on_delivery(&self, instance: &mut ComponentInstance, event: Event) {
42934291
match event {
4294-
Event::FutureRead { ty, handle, .. }
4292+
Event::FutureRead {
4293+
pending: Some((ty, handle)),
4294+
..
4295+
}
42954296
| Event::FutureWrite {
42964297
pending: Some((ty, handle)),
42974298
..
@@ -4313,7 +4314,10 @@ impl Waitable {
43134314
_ => unreachable!(),
43144315
};
43154316
}
4316-
Event::StreamRead { ty, handle, .. }
4317+
Event::StreamRead {
4318+
pending: Some((ty, handle)),
4319+
..
4320+
}
43174321
| Event::StreamWrite {
43184322
pending: Some((ty, handle)),
43194323
..

0 commit comments

Comments
 (0)