Skip to content

Commit 58cc21e

Browse files
committed
[WARP] Misc cleanup
1 parent 2a899b3 commit 58cc21e

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

plugins/warp/src/cache/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use warp::signature::function::Function;
1111
/// IMPORTANT: This will mark the function as needing updates, if you intend to fill in functions with
1212
/// no match (i.e. `None`), then you must change this function to prevent marking that as needing updates.
1313
/// However, it's perfectly valid to remove a match and need to update the function still, so be careful.
14-
pub fn insert_cached_function_match(function: &BNFunction, matched_function: Option<Function>) {
14+
pub fn insert_cached_function_match(function: &BNFunction, matched_function: Option<&Function>) {
1515
let view = function.view();
1616
let function_start = function.start();
1717
// NOTE: If we expect to run match_function multiple times on a function, we should move this elsewhere.

plugins/warp/src/cache/guid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ where
4949
// TODO: Implied constraints, symbol name, image offset
5050
let cs_constraints = cached_call_site_constraints(function);
5151
let adj_constraints = cached_adjacency_constraints(function, filter);
52-
cs_constraints.union(&adj_constraints).cloned().collect()
52+
cs_constraints.union(&adj_constraints).copied().collect()
5353
}
5454

5555
pub fn cached_call_site_constraints(function: &BNFunction) -> HashSet<Constraint> {

plugins/warp/src/plugin/ffi/function.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ pub unsafe extern "C" fn BNWARPFunctionApply(
6868
false => {
6969
// Set the matched function to `function`.
7070
let matched_function = ManuallyDrop::new(Arc::from_raw(function));
71-
insert_cached_function_match(
72-
&analysis_function,
73-
Some(matched_function.as_ref().clone()),
74-
)
71+
insert_cached_function_match(&analysis_function, Some(&matched_function))
7572
}
7673
true => {
7774
// We are removing the previous match.

plugins/warp/src/plugin/workflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub fn run_matcher(view: &BinaryView) {
202202
matched_count.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
203203
// We were able to find a match, add it to the match cache and then mark the function
204204
// as requiring updates; this is so that we know about it in the applier activity.
205-
insert_cached_function_match(function, Some(matched_function.clone()));
205+
insert_cached_function_match(function, Some(matched_function));
206206
}
207207
}
208208
});

0 commit comments

Comments
 (0)