@@ -14,7 +14,7 @@ use crate::vm::component::{ComponentInstance, HandleTable, TransmitLocalState};
1414use crate :: vm:: { AlwaysMut , VMStore } ;
1515use crate :: { AsContext , AsContextMut , StoreContextMut , ValRaw } ;
1616use crate :: {
17- Error , Result , bail, bail_bug, ensure,
17+ Error , Result , Trap , bail, bail_bug, ensure,
1818 error:: { Context as _, format_err} ,
1919} ;
2020use buffers:: { Extender , SliceBuffer , UntypedWriteBuffer } ;
@@ -3423,10 +3423,7 @@ impl Instance {
34233423 self . check_bounds ( store. 0 , options, ty, address, count) ?;
34243424 let ( rep, state) = self . id ( ) . get_mut ( store. 0 ) . get_mut_by_index ( ty, handle) ?;
34253425 let TransmitLocalState :: Write { done } = * state else {
3426- bail ! (
3427- "invalid handle {handle}; expected `Write`; got {:?}" ,
3428- * state
3429- ) ;
3426+ bail ! ( Trap :: ConcurrentFutureStreamOp ) ;
34303427 } ;
34313428
34323429 if done {
@@ -3668,7 +3665,7 @@ impl Instance {
36683665 self . check_bounds ( store. 0 , options, ty, address, count) ?;
36693666 let ( rep, state) = self . id ( ) . get_mut ( store. 0 ) . get_mut_by_index ( ty, handle) ?;
36703667 let TransmitLocalState :: Read { done } = * state else {
3671- bail_bug ! ( "invalid handle {handle}; expected `Read`; got {:?}" , * state ) ;
3668+ bail ! ( Trap :: ConcurrentFutureStreamOp ) ;
36723669 } ;
36733670
36743671 if done {
0 commit comments