Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Minor adjustment from cargo clippy #463

Merged
merged 2 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ impl<V: Verifier, C: ContextObject> Executable<V, C> {
0
};
Ok(Self {
_verifier: PhantomData::default(),
_verifier: PhantomData,
elf_bytes,
ro_section: Section::Borrowed(0, 0..text_bytes.len()),
text_section_info: SectionInfo {
Expand Down Expand Up @@ -515,7 +515,7 @@ impl<V: Verifier, C: ContextObject> Executable<V, C> {
)?;

Ok(Self {
_verifier: PhantomData::default(),
_verifier: PhantomData,
elf_bytes,
ro_section,
text_section_info,
Expand Down Expand Up @@ -2141,20 +2141,4 @@ mod test {
.expect("failed to read elf file");
ElfExecutable::load(&elf_bytes, loader()).expect("validation failed");
}

#[cfg(all(feature = "jit", not(target_os = "windows"), target_arch = "x86_64"))]
#[test]
fn test_size() {
let mut file = File::open("tests/elfs/noop.so").expect("file open failed");
let mut elf_bytes = Vec::new();
file.read_to_end(&mut elf_bytes)
.expect("failed to read elf file");
let mut executable =
ElfExecutable::from_elf(&elf_bytes, loader()).expect("validation failed");
{
Executable::jit_compile(&mut executable).unwrap();
}

assert_eq!(10546, executable.mem_size());
}
}
2 changes: 1 addition & 1 deletion src/static_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ impl<'a> Analysis<'a> {
};
}
if cfg_node.dominator_parent != dominator_parent {
let mut cfg_node = self.cfg_nodes.get_mut(b).unwrap();
let cfg_node = self.cfg_nodes.get_mut(b).unwrap();
cfg_node.dominator_parent = dominator_parent;
terminate = false;
}
Expand Down