8000 Fix - Adds error message in case `std::alloc::alloc()` fails by Lichtso · Pull Request #505 · solana-labs/rbpf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Fix - Adds error message in case std::alloc::alloc() fails #505

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,7 @@ impl<'a, C: ContextObject> JitCompiler<'a, C> {
self.set_anchor(ANCHOR_ALLOCATE_EXCEPTION);
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));
err_ptr
}
Expand Down
0