diff options
| author | Mason Reed <mason@vector35.com> | 2025-11-24 18:43:52 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-12-15 17:26:10 -0500 |
| commit | 58cc21e4fae58cedd586497a220a0bbe285ef831 (patch) | |
| tree | b7e0263abbbf079e39f966d1d828593a458275d3 /plugins/warp | |
| parent | 2a899b31320a5ebfba009961f47b8f53b4eadf02 (diff) | |
[WARP] Misc cleanup
Diffstat (limited to 'plugins/warp')
| -rw-r--r-- | plugins/warp/src/cache/function.rs | 2 | ||||
| -rw-r--r-- | plugins/warp/src/cache/guid.rs | 2 | ||||
| -rw-r--r-- | plugins/warp/src/plugin/ffi/function.rs | 5 | ||||
| -rw-r--r-- | plugins/warp/src/plugin/workflow.rs | 2 |
4 files changed, 4 insertions, 7 deletions
diff --git a/plugins/warp/src/cache/function.rs b/plugins/warp/src/cache/function.rs index a953f514..79b9e86a 100644 --- a/plugins/warp/src/cache/function.rs +++ b/plugins/warp/src/cache/function.rs @@ -11,7 +11,7 @@ use warp::signature::function::Function; /// IMPORTANT: This will mark the function as needing updates, if you intend to fill in functions with /// no match (i.e. `None`), then you must change this function to prevent marking that as needing updates. /// However, it's perfectly valid to remove a match and need to update the function still, so be careful. -pub fn insert_cached_function_match(function: &BNFunction, matched_function: Option<Function>) { +pub fn insert_cached_function_match(function: &BNFunction, matched_function: Option<&Function>) { let view = function.view(); let function_start = function.start(); // NOTE: If we expect to run match_function multiple times on a function, we should move this elsewhere. diff --git a/plugins/warp/src/cache/guid.rs b/plugins/warp/src/cache/guid.rs index 29e14858..ede54013 100644 --- a/plugins/warp/src/cache/guid.rs +++ b/plugins/warp/src/cache/guid.rs @@ -49,7 +49,7 @@ where // TODO: Implied constraints, symbol name, image offset let cs_constraints = cached_call_site_constraints(function); let adj_constraints = cached_adjacency_constraints(function, filter); - cs_constraints.union(&adj_constraints).cloned().collect() + cs_constraints.union(&adj_constraints).copied().collect() } pub fn cached_call_site_constraints(function: &BNFunction) -> HashSet<Constraint> { diff --git a/plugins/warp/src/plugin/ffi/function.rs b/plugins/warp/src/plugin/ffi/function.rs index e3f6a079..138c0a7b 100644 --- a/plugins/warp/src/plugin/ffi/function.rs +++ b/plugins/warp/src/plugin/ffi/function.rs @@ -68,10 +68,7 @@ pub unsafe extern "C" fn BNWARPFunctionApply( false => { // Set the matched function to `function`. let matched_function = ManuallyDrop::new(Arc::from_raw(function)); - insert_cached_function_match( - &analysis_function, - Some(matched_function.as_ref().clone()), - ) + insert_cached_function_match(&analysis_function, Some(&matched_function)) } true => { // We are removing the previous match. diff --git a/plugins/warp/src/plugin/workflow.rs b/plugins/warp/src/plugin/workflow.rs index fe4eef68..da988581 100644 --- a/plugins/warp/src/plugin/workflow.rs +++ b/plugins/warp/src/plugin/workflow.rs @@ -202,7 +202,7 @@ pub fn run_matcher(view: &BinaryView) { matched_count.fetch_add(1, std::sync::atomic::Ordering::Relaxed); // We were able to find a match, add it to the match cache and then mark the function // as requiring updates; this is so that we know about it in the applier activity. - insert_cached_function_match(function, Some(matched_function.clone())); + insert_cached_function_match(function, Some(matched_function)); } } }); |
