Skip to content

Commit

Permalink
Small bug fix in NVM ELF loader (#62)
Browse files Browse the repository at this point in the history
* remove unnecessary dependencies from riscv crate

* small bug fix in NVM ELF loader
  • Loading branch information
govereau authored Feb 7, 2024
1 parent 23fcf03 commit 8ec0d31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vm/src/riscv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub fn translate_elf_bytes(bytes: &[u8]) -> Result<NexusVM> {
// write code segment
let s = code.p_offset as u32;
let e = (code.p_offset + code.p_filesz) as u32;
for i in s..e {
for i in (s..e).step_by(4) {
let inst = parse_inst(i, &bytes[i as usize..])?;
let pc = s + (i - s) * 2;
let inst = translate_inst(s, e, inst);
Expand Down

0 comments on commit 8ec0d31

Please sign in to comment.