File tree Expand file tree Collapse file tree 6 files changed +113
-91
lines changed
Expand file tree Collapse file tree 6 files changed +113
-91
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,8 @@ impl BlockType {
233233 } ,
234234 } ) ,
235235 BlockType :: Type ( type_idx) => {
236- // SAFETY: Upheld by the caller
236+ // SAFETY: The caller ensures that this `IdxVec` is the same one
237+ // used to validate the `TypeIdx` in `self`.
237238 let func_type = unsafe { func_types. get ( * type_idx) } ;
238239 Ok ( func_type. clone ( ) )
239240 }
Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ pub(crate) fn run_const<T: Config>(
5757
5858 let module_instance = store. modules . get ( module) ;
5959
60- // SAFETY: Validation guarantees the global index to be valid
61- // for the current module.
60+ // SAFETY: Validation guarantees the global index to be valid in
61+ // the current module.
6262 let global_addr = * unsafe { module_instance. global_addrs . get ( global_idx) } ;
6363
6464 let global = store. globals . get ( global_addr) ;
@@ -100,7 +100,7 @@ pub(crate) fn run_const<T: Config>(
100100 // index next.
101101 let func_idx = unsafe { FuncIdx :: read_unchecked ( wasm) } ;
102102 // SAFETY: Validation guarantees the function index to be valid
103- // for the current module.
103+ // in the current module.
104104 let func_addr = unsafe { store. modules . get ( module) . func_addrs . get ( func_idx) } ;
105105 stack. push_value :: < T > ( Value :: Ref ( Ref :: Func ( * func_addr) ) ) ?;
106106 }
You can’t perform that action at this time.
0 commit comments