Skip to content

Commit

Permalink
fix: prevent potential UB by deriving repr C for union
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalpharush committed Nov 6, 2023
1 parent d18aa79 commit eff2c42
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/vm/src/vmcontext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use wasmer_types::RawValue;
/// It may either be a pointer to the [`VMContext`] if it's a Wasm function
/// or a pointer to arbitrary data controlled by the host if it's a host function.
#[derive(Copy, Clone, Eq)]
#[repr(C)]
pub union VMFunctionContext {
/// Wasm functions take a pointer to [`VMContext`].
pub vmctx: *mut VMContext,
Expand Down

0 comments on commit eff2c42

Please sign in to comment.