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

Commit 9ecc4c4

Browse files
committed
Removes unnecessary debug mode arithmetic guard.
1 parent e64598f commit 9ecc4c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/interpreter.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ macro_rules! check_pc {
6767
($self:expr, $next_pc:ident, $target_pc:expr) => {
6868
if ($target_pc as usize)
6969
.checked_mul(ebpf::INSN_SIZE)
70-
.and_then(|offset| $self.program.get(offset..offset + ebpf::INSN_SIZE))
70+
.and_then(|offset| {
71+
$self
72+
.program
73+
.get(offset..offset.saturating_add(ebpf::INSN_SIZE))
74+
})
7175
.is_some()
7276
{
7377
$next_pc = $target_pc;

0 commit comments

Comments
 (0)