@@ -4,7 +4,7 @@ use crate::rr::FlatBytes;
44#[ cfg( feature = "rr" ) ]
55use crate :: rr:: {
66 RREvent , RRFuncArgVals , RRFuncArgValsConvertable , ReplayError , Replayer , ResultEvent , Validate ,
7- common_events:: { HostFuncEntryEvent , HostFuncReturnEvent , WasmFuncReturnEvent } ,
7+ common_events:: { HostFuncEntryEvent , HostFuncReturnEvent , MemoryGrowEvent , TableGrowEvent , WasmFuncReturnEvent } ,
88 core_events:: { InstantiationEvent , WasmFuncEntryEvent } ,
99} ;
1010use crate :: store:: { InstanceId , StoreOpaque } ;
@@ -215,6 +215,40 @@ pub fn record_and_replay_validate_instantiation<T: 'static>(
215215 Ok ( ( ) )
216216}
217217
218+ /// Record and replay hook for memory.grow return value
219+ #[ inline]
220+ pub fn record_and_replay_validate_memory_grow (
221+ result : u32 ,
222+ store : & mut StoreOpaque ,
223+ ) -> Result < ( ) > {
224+ let _ = ( result, & store) ;
225+ #[ cfg( feature = "rr" ) ]
226+ {
227+ store. record_event ( || MemoryGrowEvent { result } ) ?;
228+ store. next_replay_event_validation :: < MemoryGrowEvent , _ , _ > ( || MemoryGrowEvent {
229+ result,
230+ } ) ?;
231+ }
232+ Ok ( ( ) )
233+ }
234+
235+ /// Record and replay hook for table.grow return value
236+ #[ inline]
237+ pub fn record_and_replay_validate_table_grow (
238+ result : u32 ,
239+ store : & mut StoreOpaque ,
240+ ) -> Result < ( ) > {
241+ let _ = ( result, & store) ;
242+ #[ cfg( feature = "rr" ) ]
243+ {
244+ store. record_event ( || TableGrowEvent { result } ) ?;
245+ store. next_replay_event_validation :: < TableGrowEvent , _ , _ > ( || TableGrowEvent {
246+ result,
247+ } ) ?;
248+ }
249+ Ok ( ( ) )
250+ }
251+
218252/// Ensure that memories are not exported memories in Core wasm modules when
219253/// recording is enabled.
220254pub fn rr_validate_module_unexported_memory ( module : & Module ) -> Result < ( ) > {
0 commit comments