summaryrefslogtreecommitdiff
path: root/rust/src/low_level_il
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/low_level_il')
-rw-r--r--rust/src/low_level_il/function.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/rust/src/low_level_il/function.rs b/rust/src/low_level_il/function.rs
index 8af89652..2eaf7f11 100644
--- a/rust/src/low_level_il/function.rs
+++ b/rust/src/low_level_il/function.rs
@@ -106,7 +106,8 @@ where
) -> Option<LowLevelInstructionIndex> {
use binaryninjacore_sys::BNLowLevelILGetInstructionStart;
let loc: Location = loc.into();
- let arch = loc.arch.unwrap_or_else(|| *self.arch().as_ref());
+ // If the location does not specify an architecture, use the function's architecture.
+ let arch = loc.arch.unwrap_or_else(|| self.arch());
let instr_idx =
unsafe { BNLowLevelILGetInstructionStart(self.handle, arch.handle, loc.addr) };
// `instr_idx` will equal self.instruction_count() if the instruction is not valid.