Skip to content

Commit

Permalink
Fix negate with overflow (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmay committed Nov 17, 2020
1 parent d4dde68 commit 63f86be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ impl<'a, E: UserDefinedError> EbpfVm<'a, E> {
}
reg[dst] >>= reg[src]
},
ebpf::NEG64 => reg[dst] = -(reg[dst] as i64) as u64,
ebpf::NEG64 => reg[dst] = (reg[dst] as i64).wrapping_neg() as u64,
ebpf::MOD64_IMM => reg[dst] %= insn.imm as u64,
ebpf::MOD64_REG => {
if reg[src] == 0 {
Expand Down

0 comments on commit 63f86be

Please sign in to comment.