Skip to content

Commit

Permalink
Makes the ExhaustedTextSegment check more conservative.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Sep 4, 2024
1 parent fa9f3e4 commit 6b58569
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ impl<'a, C: ContextObject> JitCompiler<'a, C> {
self.emit_subroutines();

while self.pc * ebpf::INSN_SIZE < self.program.len() {
if self.offset_in_text_section + MAX_MACHINE_CODE_LENGTH_PER_INSTRUCTION > self.result.text_section.len() {
if self.offset_in_text_section + MAX_MACHINE_CODE_LENGTH_PER_INSTRUCTION * 2 >= self.result.text_section.len() {
return Err(EbpfError::ExhaustedTextSegment(self.pc));
}
let mut insn = ebpf::get_insn_unchecked(self.program, self.pc);
Expand Down

0 comments on commit 6b58569

Please sign in to comment.