Skip to content

Commit

Permalink
Fix callx base address (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmay authored Sep 4, 2019
1 parent 43343e2 commit 3a1dcc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ impl<'a> EbpfVm<'a> {
format!("Error: callx at instruction #{:?} attempted to call outside of the text segment at addr {:#x}",
pc - 1 + ebpf::ELF_INSN_DUMP_OFFSET, reg[insn.imm as usize])));
}
pc = (target_address - ebpf::MM_PROGRAM_START) as usize / ebpf::INSN_SIZE;
pc = (target_address - prog_addr) as usize / ebpf::INSN_SIZE;
},

// Do not delegate the check to the verifier, since registered functions can be
Expand Down

0 comments on commit 3a1dcc8

Please sign in to comment.