@@ -157,11 +157,15 @@ impl TinyInst {
157157 . collect ( ) ;
158158 tinyinst_args_ptr. push ( core:: ptr:: null_mut ( ) ) ;
159159
160- // Init TinyInst with Tinyinst arguments.
161- tinyinst_ptr. pin_mut ( ) . Init (
162- i32:: try_from ( tinyinst_args. len ( ) ) . unwrap ( ) ,
163- tinyinst_args_ptr. as_mut_ptr ( ) ,
164- ) ;
160+ // Init TinyInst with TinyInst arguments.
161+ // # Safety
162+ // The arguments and pointers are valid at this point
163+ unsafe {
164+ tinyinst_ptr. pin_mut ( ) . Init (
165+ i32:: try_from ( tinyinst_args. len ( ) ) . unwrap ( ) ,
166+ tinyinst_args_ptr. as_mut_ptr ( ) ,
167+ ) ;
168+ }
165169
166170 let program_args_cstr: Vec < CString > = program_args
167171 . iter ( )
@@ -184,12 +188,14 @@ impl TinyInst {
184188 }
185189
186190 pub unsafe fn run ( & mut self ) -> litecov:: RunResult {
187- self . tinyinst_ptr . pin_mut ( ) . Run (
188- i32:: try_from ( self . program_args_cstr . len ( ) ) . unwrap ( ) ,
189- self . program_args_ptr . as_mut_ptr ( ) ,
190- self . timeout ,
191- self . timeout ,
192- )
191+ unsafe {
192+ self . tinyinst_ptr . pin_mut ( ) . Run (
193+ i32:: try_from ( self . program_args_cstr . len ( ) ) . unwrap ( ) ,
194+ self . program_args_ptr . as_mut_ptr ( ) ,
195+ self . timeout ,
196+ self . timeout ,
197+ )
198+ }
193199 }
194200
195201 // pub unsafe fn bitmap_coverage(
0 commit comments