From 32f43bb7f0cb232d8fcdf781ae49c4bb5a347f67 Mon Sep 17 00:00:00 2001 From: Lucas Steuernagel Date: Mon, 21 Oct 2024 15:29:06 -0300 Subject: [PATCH] Rebase onto main --- src/elf.rs | 2 +- src/program.rs | 6 +++--- src/static_analysis.rs | 6 +----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/elf.rs b/src/elf.rs index 1b39b3a6..640073c3 100644 --- a/src/elf.rs +++ b/src/elf.rs @@ -1072,7 +1072,7 @@ impl Executable { .or_insert_with(|| ebpf::hash_symbol_name(name)); if config.reject_broken_elfs && loader - .get_function_registry(&SBPFVersion::V1) + .get_function_registry(SBPFVersion::V1) .lookup_by_key(hash) .is_none() { diff --git a/src/program.rs b/src/program.rs index 83004484..781849cc 100644 --- a/src/program.rs +++ b/src/program.rs @@ -154,7 +154,7 @@ impl FunctionRegistry { ebpf::hash_symbol_name(&usize::from(value).to_le_bytes()) }; if loader - .get_function_registry(&SBPFVersion::V1) + .get_function_registry(SBPFVersion::V1) .lookup_by_key(hash) .is_some() { @@ -292,9 +292,9 @@ impl BuiltinProgram { /// Get the function registry depending on the SBPF version pub fn get_function_registry( &self, - sbpf_version: &SBPFVersion, + sbpf_version: SBPFVersion, ) -> &FunctionRegistry> { - if sbpf_version == &SBPFVersion::V1 { + if sbpf_version == SBPFVersion::V1 { &self.sparse_registry } else { &self.dense_registry diff --git a/src/static_analysis.rs b/src/static_analysis.rs index 2d95175d..77dde3b1 100644 --- a/src/static_analysis.rs +++ b/src/static_analysis.rs @@ -224,11 +224,7 @@ impl<'a> Analysis<'a> { /// Splits the sequence of instructions into basic blocks /// /// Also links the control-flow graph edges between the basic blocks. - pub fn split_into_basic_blocks( - &mut self, - flatten_call_graph: bool, - sbpf_version: &SBPFVersion, - ) { + pub fn split_into_basic_blocks(&mut self, flatten_call_graph: bool, sbpf_version: SBPFVersion) { self.cfg_nodes.insert(0, CfgNode::default()); for pc in self.functions.keys() { self.cfg_nodes.entry(*pc).or_default();