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

Fix LDDW Related Bugs #140

Merged
merged 4 commits into from
Feb 12, 2021
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
4 changes: 2 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use clap::{App, Arg};
use rustc_demangle::demangle;
use solana_rbpf::{
assembler::assemble,
disassembler::{to_insn_vec, HLInsn},
disassembler::{to_insn_vec, HlInsn},
ebpf,
memory_region::{MemoryMapping, MemoryRegion},
user_error::UserError,
Expand Down Expand Up @@ -63,7 +63,7 @@ macro_rules! resolve_label {
}

struct AnalysisResult {
instructions: Vec<HLInsn>,
instructions: Vec<HlInsn>,
destinations: BTreeMap<usize, Label>,
sources: BTreeMap<usize, Vec<usize>>,
}
Expand Down
12 changes: 6 additions & 6 deletions src/disassembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn jmp_reg_str(name: &str, insn: &ebpf::Insn) -> String {
/// documentation about eBPF, or <https://github.com/iovisor/bpf-docs/blob/master/eBPF.md> for a
/// more concise version.
#[derive(Debug, PartialEq)]
pub struct HLInsn {
pub struct HlInsn {
/// Instruction pointer.
pub ptr: usize,
/// Operation code.
Expand All @@ -102,7 +102,7 @@ pub struct HLInsn {
pub imm: i64,
}

/// Return a vector of `struct HLInsn` built from an eBPF program.
/// Return a vector of `struct HlInsn` built from an eBPF program.
///
/// This is made public to provide a way to manipulate a program as a vector of instructions, in a
/// high-level format, for example for dumping the program instruction after instruction with a
Expand Down Expand Up @@ -133,7 +133,7 @@ pub struct HLInsn {
///
/// let v = disassembler::to_insn_vec(prog);
/// assert_eq!(v, vec![
/// disassembler::HLInsn {
/// disassembler::HlInsn {
/// ptr: 0,
/// opc: 0x18,
/// name: "lddw".to_string(),
Expand All @@ -143,7 +143,7 @@ pub struct HLInsn {
/// off: 0,
/// imm: 0x1122334455667788
/// },
/// disassembler::HLInsn {
/// disassembler::HlInsn {
/// ptr: 2,
/// opc: 0x95,
/// name: "exit".to_string(),
Expand All @@ -156,7 +156,7 @@ pub struct HLInsn {
/// ]);
/// ```
#[rustfmt::skip]
pub fn to_insn_vec(prog: &[u8]) -> Vec<HLInsn> {
pub fn to_insn_vec(prog: &[u8]) -> Vec<HlInsn> {
debug_assert!(prog.len() % ebpf::INSN_SIZE == 0, "eBPF program length must be a multiple of {:?} octets is {:?}", ebpf::INSN_SIZE, prog.len());

if prog.is_empty() {
Expand Down Expand Up @@ -301,7 +301,7 @@ pub fn to_insn_vec(prog: &[u8]) -> Vec<HLInsn> {
},
};

res.push(HLInsn {
res.push(HlInsn {
ptr,
opc: insn.opc,
name: name.to_string(),
Expand Down
Loading