From f4f55088e3d78c15e7751c8d062562783f2dcdda Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Wed, 2 Aug 2023 08:58:49 +0100 Subject: [PATCH] ControlFlowGraph::calculate_difference_all_edges build warning fix. (#1390) get_edge returns a reference, anyhow CfgEdge does implement the Borrow's trait neither. --- libafl_cc/src/cfg.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libafl_cc/src/cfg.rs b/libafl_cc/src/cfg.rs index 5caa96c360..2c5aed01f1 100644 --- a/libafl_cc/src/cfg.rs +++ b/libafl_cc/src/cfg.rs @@ -1,6 +1,5 @@ //! LLVM style control flow graph with information of AFL-style index of the each //! edges, use together with ``AFLCoverage`` pass having --dump-afl-cfg flag enabled. -use core::borrow::Borrow; use std::{ collections::{BinaryHeap, HashMap, HashSet}, marker::PhantomData, @@ -313,10 +312,8 @@ where } if let Some(edge_info) = self.get_edge(edge) { for successor in &edge_info.successor_edges { - let successor_info = self - .get_edge(*successor) - .expect("unknown successor added") - .borrow(); + let successor_info = + self.get_edge(*successor).expect("unknown successor added"); let new_distance = distance + successor_info.get_weight(); let is_shorter = distances .get(successor)