diff options
| author | Mason Reed <mason@vector35.com> | 2025-12-06 17:06:16 -0500 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2025-12-10 17:35:19 -0500 |
| commit | 7090d904513c3e80321bb6a8aba9c3b37d809bac (patch) | |
| tree | 0a329b0d6b01c4bd7a2ed9547f6862fce8f08fa1 /rust/src/binary_view.rs | |
| parent | e699fec29106d46303ef4bcb464a768e23bb28ea (diff) | |
[Rust] Remove redundant `ArchAndAddr` type
Use `Location` instead, `arch` can be a nullptr
Diffstat (limited to 'rust/src/binary_view.rs')
| -rw-r--r-- | rust/src/binary_view.rs | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/rust/src/binary_view.rs b/rust/src/binary_view.rs index 4b55e321..e1b7a5c0 100644 --- a/rust/src/binary_view.rs +++ b/rust/src/binary_view.rs @@ -38,7 +38,7 @@ use crate::external_library::{ExternalLibrary, ExternalLocation}; use crate::file_accessor::{Accessor, FileAccessor}; use crate::file_metadata::FileMetadata; use crate::flowgraph::FlowGraph; -use crate::function::{ArchAndAddr, Function, FunctionViewType, NativeBlock}; +use crate::function::{Function, FunctionViewType, Location, NativeBlock}; use crate::linear_view::{LinearDisassemblyLine, LinearViewCursor}; use crate::metadata::Metadata; use crate::platform::Platform; @@ -1445,29 +1445,23 @@ pub trait BinaryViewExt: BinaryViewBase { } } + // TODO: Should this instead be implemented on [`Function`] considering `src_func`? `Location` is local to the source function. fn should_skip_target_analysis( &self, - source: &ArchAndAddr, - srcfunc: &Function, - srcend: u64, - target: &ArchAndAddr, + src_loc: impl Into<Location>, + src_func: &Function, + src_end: u64, + target: impl Into<Location>, ) -> bool { - let mut srccopy = BNArchitectureAndAddress { - arch: source.arch.handle, - address: source.addr, - }; - let mut targetcopy = BNArchitectureAndAddress { - arch: target.arch.handle, - address: target.addr, - }; - + let src_loc = src_loc.into(); + let target = target.into(); unsafe { BNShouldSkipTargetAnalysis( self.as_ref().handle, - &mut srccopy, - srcfunc.handle, - srcend, - &mut targetcopy, + &mut src_loc.into(), + src_func.handle, + src_end, + &mut target.into(), ) } } |
