File tree Expand file tree Collapse file tree 4 files changed +4
-7
lines changed
Expand file tree Collapse file tree 4 files changed +4
-7
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff line change 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
5555pub fn cached_call_site_constraints ( function : & BNFunction ) -> HashSet < Constraint > {
Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments