Skip to content

Commit

Permalink
Mark JitFn fns as unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDan64 committed Jan 21, 2023
1 parent 1bbe59d commit 15cbacf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/execution_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,15 @@ impl<'ctx, F: Copy> JitFunction<'ctx, F> {
/// This function is unsafe because the function pointer may dangle
/// if the ExecutionEngine it came from is dropped. The caller is
/// thus responsible for ensuring the ExecutionEngine remains valid.
pub fn into_raw(self) -> F {
pub unsafe fn into_raw(self) -> F {
self.inner
}

/// Returns the raw function pointer.
/// This function is unsafe because the function pointer may dangle
/// if the ExecutionEngine it came from is dropped. The caller is
/// thus responsible for ensuring the ExecutionEngine remains valid.
pub fn as_raw(&self) -> F {
pub unsafe fn as_raw(&self) -> F {
self.inner
}
}
Expand Down

0 comments on commit 15cbacf

Please sign in to comment.