Method
with_uc_ptr
(
&mut self,
vm: &mut icicle_vm::Vm,
handler: impl FnOnce(*mut uc_engine) -> R,
)
Source from the content-addressed store, hash-verified
| 45 | } |
| 46 | |
| 47 | fn with_uc_ptr<R>( |
| 48 | &mut self, |
| 49 | vm: &mut icicle_vm::Vm, |
| 50 | handler: impl FnOnce(*mut uc_engine) -> R, |
| 51 | ) -> R { |
| 52 | self.ctx.as_mut().unwrap().get_mut().vm = vm; |
| 53 | |
| 54 | let result = unsafe { |
| 55 | let uc_ptr = self.ctx.as_mut().unwrap().get_mut().uc_ptr(); |
| 56 | handler(uc_ptr) |
| 57 | }; |
| 58 | |
| 59 | result |
| 60 | } |
| 61 | |
| 62 | pub fn get_mmio_handler<'a>(&self, vm: &'a mut icicle_vm::Vm) -> Option<&'a mut T> |
| 63 | where |
Tested by
no test coverage detected