(
&self,
loc: L,
)
| 109 | } |
| 110 | |
| 111 | pub fn instruction_index_at<L: Into<Location>>( |
| 112 | &self, |
| 113 | loc: L, |
| 114 | ) -> Option<LowLevelInstructionIndex> { |
| 115 | use binaryninjacore_sys::BNLowLevelILGetInstructionStart; |
| 116 | let loc: Location = loc.into(); |
| 117 | let arch = loc.arch.unwrap_or_else(|| *self.arch().as_ref()); |
| 118 | let instr_idx = |
| 119 | unsafe { BNLowLevelILGetInstructionStart(self.handle, arch.handle, loc.addr) }; |
| 120 | // `instr_idx` will equal self.instruction_count() if the instruction is not valid. |
| 121 | if instr_idx >= self.instruction_count() { |
| 122 | None |
| 123 | } else { |
| 124 | Some(LowLevelInstructionIndex(instr_idx)) |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | pub fn instruction_from_index( |
| 129 | &self, |
no test coverage detected