Skip to content

Commit

Permalink
Stops using assign as that drops the previously (non) existing value. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso authored Sep 12, 2023
1 parent c001c6c commit e7aaea2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1329,10 +1329,10 @@ impl<'a, C: ContextObject> JitCompiler<'a, C> {

// Routine for allocating errors
self.set_anchor(ANCHOR_ALLOCATE_EXCEPTION);
unsafe fn allocate_error(result: &mut ProgramResult) -> *mut EbpfError {
unsafe fn allocate_error(result: *mut ProgramResult) -> *mut EbpfError {
let err_ptr = std::alloc::alloc(std::alloc::Layout::new::<EbpfError>()) as *mut EbpfError;
assert!(!err_ptr.is_null(), "std::alloc::alloc() failed");
*result = ProgramResult::Err(Box::from_raw(err_ptr));
result.write(ProgramResult::Err(Box::from_raw(err_ptr)));
err_ptr
}
self.emit_ins(X86Instruction::lea(OperandSize::S64, RBP, R10, Some(X86IndirectAccess::Offset(self.slot_on_environment_stack(RuntimeEnvironmentSlot::ProgramResult)))));
Expand Down

0 comments on commit e7aaea2

Please sign in to comment.