Type Alias miri::machine::MiriInterpCx

source ·
pub type MiriInterpCx<'tcx> = InterpCx<'tcx, MiriMachine<'tcx>>;
Expand description

A rustc InterpCx for Miri.

Aliased Type§

struct MiriInterpCx<'tcx> {
    pub machine: MiriMachine<'tcx>,
    pub tcx: TyCtxtAt<'tcx>,
    pub memory: Memory<'tcx, MiriMachine<'tcx>>,
    pub recursion_limit: Limit,
    /* private fields */
}

Fields§

§machine: MiriMachine<'tcx>

Stores the Machine instance.

Note: the stack is provided by the machine.

§tcx: TyCtxtAt<'tcx>

The results of the type checker, from rustc. The span in this is the “root” of the evaluation, i.e., the const we are evaluating (if this is CTFE).

§memory: Memory<'tcx, MiriMachine<'tcx>>

The virtual memory system.

§recursion_limit: Limit

The recursion limit (cached from tcx.recursion_limit(()))

Trait Implementations§

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn expose_ptr(&mut self, alloc_id: AllocId, tag: BorTag) -> InterpResult<'tcx>

source§

fn ptr_from_addr_cast(&self, addr: u64) -> InterpResult<'tcx, Pointer>

source§

fn adjust_alloc_root_pointer( &self, ptr: Pointer<CtfeProvenance>, tag: BorTag, kind: MemoryKind, ) -> InterpResult<'tcx, Pointer<Provenance>>

Convert a relative (tcx) pointer to a Miri pointer.
source§

fn get_global_alloc_bytes( &self, id: AllocId, kind: MemoryKind, bytes: &[u8], align: Align, ) -> InterpResult<'tcx, MiriAllocBytes>

source§

fn ptr_get_alloc( &self, ptr: Pointer<Provenance>, size: i64, ) -> Option<(AllocId, Size)>

When a pointer is used for a memory access, this computes where in which allocation the access is going.
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn sb_retag_ptr_value( &mut self, kind: RetagKind, val: &ImmTy<'tcx>, ) -> InterpResult<'tcx, ImmTy<'tcx>>

source§

fn sb_retag_place_contents( &mut self, kind: RetagKind, place: &PlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn sb_protect_place( &mut self, place: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, MPlaceTy<'tcx>>

Protect a place so that it cannot be used any more for the duration of the current function call. Read more
source§

fn sb_expose_tag( &mut self, alloc_id: AllocId, tag: BorTag, ) -> InterpResult<'tcx>

Mark the given tag as exposed. It was found on a pointer with the given AllocId.
source§

fn print_stacks(&mut self, alloc_id: AllocId) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn have_module(&self, path: &[&str]) -> bool

Checks if the given crate/module exists.
source§

fn eval_path(&self, path: &[&str]) -> OpTy<'tcx>

Evaluates the scalar at the specified path.
source§

fn eval_path_scalar(&self, path: &[&str]) -> Scalar

source§

fn eval_libc(&self, name: &str) -> Scalar

Helper function to get a libc constant as a Scalar.
source§

fn eval_libc_i32(&self, name: &str) -> i32

Helper function to get a libc constant as an i32.
source§

fn eval_libc_u32(&self, name: &str) -> u32

Helper function to get a libc constant as an u32.
source§

fn eval_windows(&self, module: &str, name: &str) -> Scalar

Helper function to get a windows constant as a Scalar.
source§

fn eval_windows_u32(&self, module: &str, name: &str) -> u32

Helper function to get a windows constant as a u32.
source§

fn eval_windows_u64(&self, module: &str, name: &str) -> u64

Helper function to get a windows constant as a u64.
source§

fn libc_ty_layout(&self, name: &str) -> TyAndLayout<'tcx>

Helper function to get the TyAndLayout of a libc type
source§

fn windows_ty_layout(&self, name: &str) -> TyAndLayout<'tcx>

Helper function to get the TyAndLayout of a windows type
source§

fn libc_array_ty_layout(&self, name: &str, size: u64) -> TyAndLayout<'tcx>

Helper function to get TyAndLayout of an array that consists of libc type.
source§

fn project_field_named<P: Projectable<'tcx, Provenance>>( &self, base: &P, name: &str, ) -> InterpResult<'tcx, P>

Project to the given named field (which must be a struct or union type).
source§

fn projectable_has_field<P: Projectable<'tcx, Provenance>>( &self, base: &P, name: &str, ) -> bool

Search if base (which must be a struct or union type) contains the name field.
source§

fn write_int( &mut self, i: impl Into<i128>, dest: &impl Writeable<'tcx, Provenance>, ) -> InterpResult<'tcx>

Write an int of the appropriate size to dest. The target type may be signed or unsigned, we try to do the right thing anyway. i128 can fit all integer types except for u128 so this method is fine for almost all integer types.
source§

fn write_int_fields( &mut self, values: &[i128], dest: &impl Writeable<'tcx, Provenance>, ) -> InterpResult<'tcx>

Write the first N fields of the given place.
source§

fn write_int_fields_named( &mut self, values: &[(&str, i128)], dest: &impl Writeable<'tcx, Provenance>, ) -> InterpResult<'tcx>

Write the given fields of the given place.
source§

fn write_null( &mut self, dest: &impl Writeable<'tcx, Provenance>, ) -> InterpResult<'tcx>

Write a 0 of the appropriate size to dest.
source§

fn ptr_is_null(&self, ptr: Pointer) -> InterpResult<'tcx, bool>

Test if this pointer equals 0.
source§

fn gen_random(&mut self, ptr: Pointer, len: u64) -> InterpResult<'tcx>

Generate some random bytes, and write them to dest.
source§

fn call_function( &mut self, f: Instance<'tcx>, caller_abi: Abi, args: &[ImmTy<'tcx>], dest: Option<&MPlaceTy<'tcx>>, stack_pop: StackPopCleanup, ) -> InterpResult<'tcx>

Call a function: Push the stack frame and pass the arguments. For now, arguments must be scalars (so that the caller does not have to know the layout). Read more
source§

fn visit_freeze_sensitive( &self, place: &MPlaceTy<'tcx>, size: Size, action: impl FnMut(AllocRange, bool) -> InterpResult<'tcx>, ) -> InterpResult<'tcx>

Visits the memory covered by place, sensitive to freezing: the 2nd parameter of action will be true if this is frozen, false if this is in an UnsafeCell. The range is relative to place.
source§

fn check_no_isolation(&self, name: &str) -> InterpResult<'tcx>

Helper function used inside the shims of foreign functions to check that isolation is disabled. It returns an error using the name of the foreign function if this is not the case.
source§

fn reject_in_isolation( &self, op_name: &str, reject_with: RejectOpWith, ) -> InterpResult<'tcx>

Helper function used inside the shims of foreign functions which reject the op when isolation is enabled. It is used to print a warning/backtrace about the rejection.
source§

fn assert_target_os(&self, target_os: &str, name: &str)

Helper function used inside the shims of foreign functions to assert that the target OS is target_os. It panics showing a message with the name of the foreign function if this is not the case.
source§

fn assert_target_os_is_unix(&self, name: &str)

Helper function used inside the shims of foreign functions to assert that the target OS is part of the UNIX family. It panics showing a message with the name of the foreign function if this is not the case.
source§

fn target_os_is_unix(&self) -> bool

source§

fn last_error_place(&mut self) -> InterpResult<'tcx, MPlaceTy<'tcx>>

Get last error variable as a place, lazily allocating thread-local storage for it if necessary.
source§

fn set_last_error(&mut self, scalar: Scalar) -> InterpResult<'tcx>

Sets the last error variable.
source§

fn get_last_error(&mut self) -> InterpResult<'tcx, Scalar>

Gets the last error variable.
source§

fn io_error_to_errnum(&self, err: Error) -> InterpResult<'tcx, Scalar>

This function tries to produce the most similar OS error from the std::io::ErrorKind as a platform-specific errnum.
source§

fn try_errnum_to_io_error( &self, errnum: Scalar, ) -> InterpResult<'tcx, Option<ErrorKind>>

The inverse of io_error_to_errnum.
source§

fn set_last_error_from_io_error(&mut self, err: Error) -> InterpResult<'tcx>

Sets the last OS error using a std::io::ErrorKind.
source§

fn try_unwrap_io_result<T: From<i32>>( &mut self, result: Result<T>, ) -> InterpResult<'tcx, T>

Helper function that consumes an std::io::Result<T> and returns an InterpResult<'tcx,T>::Ok instead. In case the result is an error, this function returns Ok(-1) and sets the last OS error accordingly. Read more
source§

fn deref_pointer_as( &self, op: &impl Readable<'tcx, Provenance>, layout: TyAndLayout<'tcx>, ) -> InterpResult<'tcx, MPlaceTy<'tcx>>

Dereference a pointer operand to a place using layout instead of the pointer’s declared type
source§

fn deref_pointer_and_offset( &self, op: &impl Readable<'tcx, Provenance>, offset: u64, base_layout: TyAndLayout<'tcx>, value_layout: TyAndLayout<'tcx>, ) -> InterpResult<'tcx, MPlaceTy<'tcx>>

Calculates the MPlaceTy given the offset and layout of an access on an operand
source§

fn deref_pointer_and_read( &self, op: &impl Readable<'tcx, Provenance>, offset: u64, base_layout: TyAndLayout<'tcx>, value_layout: TyAndLayout<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn deref_pointer_and_write( &mut self, op: &impl Readable<'tcx, Provenance>, offset: u64, value: impl Into<Scalar>, base_layout: TyAndLayout<'tcx>, value_layout: TyAndLayout<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn read_timespec( &mut self, tp: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, Option<Duration>>

Parse a timespec struct and return it as a std::time::Duration. It returns None if the value in the timespec struct is invalid. Some libc functions will return EINVAL in this case.
source§

fn read_byte_slice<'a>( &'a self, slice: &ImmTy<'tcx>, ) -> InterpResult<'tcx, &'a [u8]>
where 'tcx: 'a,

Read bytes from a byte slice.
source§

fn read_c_str<'a>(&'a self, ptr: Pointer) -> InterpResult<'tcx, &'a [u8]>
where 'tcx: 'a,

Read a sequence of bytes until the first null terminator.
source§

fn write_c_str( &mut self, c_str: &[u8], ptr: Pointer, size: u64, ) -> InterpResult<'tcx, (bool, u64)>

Helper function to write a sequence of bytes with an added null-terminator, which is what the Unix APIs usually handle. This function returns Ok((false, length)) without trying to write if size is not large enough to fit the contents of c_str plus a null terminator. It returns Ok((true, length)) if the writing process was successful. The string length returned does include the null terminator.
source§

fn read_c_str_with_char_size<T>( &self, ptr: Pointer, size: Size, align: Align, ) -> InterpResult<'tcx, Vec<T>>
where T: TryFrom<u128>, <T as TryFrom<u128>>::Error: Debug,

Helper function to read a sequence of unsigned integers of the given size and alignment until the first null terminator.
source§

fn read_wide_str(&self, ptr: Pointer) -> InterpResult<'tcx, Vec<u16>>

Read a sequence of u16 until the first null terminator.
source§

fn write_wide_str( &mut self, wide_str: &[u16], ptr: Pointer, size: u64, ) -> InterpResult<'tcx, (bool, u64)>

Helper function to write a sequence of u16 with an added 0x0000-terminator, which is what the Windows APIs usually handle. This function returns Ok((false, length)) without trying to write if size is not large enough to fit the contents of os_string plus a null terminator. It returns Ok((true, length)) if the writing process was successful. The string length returned does include the null terminator. Length is measured in units of u16.
source§

fn read_wchar_t_str(&self, ptr: Pointer) -> InterpResult<'tcx, Vec<u32>>

Read a sequence of wchar_t until the first null terminator. Always returns a Vec<u32> no matter the size of wchar_t.
source§

fn check_abi<'a>(&self, abi: Abi, exp_abi: Abi) -> InterpResult<'a, ()>

Check that the ABI is what we expect.
source§

fn frame_in_std(&self) -> bool

source§

fn handle_unsupported_foreign_item( &mut self, error_msg: String, ) -> InterpResult<'tcx, ()>

Handler that should be called when an unsupported foreign item is encountered. This function will either panic within the context of the emulated application or return an error in the Miri process context
source§

fn check_abi_and_shim_symbol_clash( &mut self, abi: Abi, exp_abi: Abi, link_name: Symbol, ) -> InterpResult<'tcx, ()>

source§

fn check_shim<'a, const N: usize>( &mut self, abi: Abi, exp_abi: Abi, link_name: Symbol, args: &'a [OpTy<'tcx>], ) -> InterpResult<'tcx, &'a [OpTy<'tcx>; N]>
where &'a [OpTy<'tcx>; N]: TryFrom<&'a [OpTy<'tcx>]>,

source§

fn mark_immutable(&mut self, mplace: &MPlaceTy<'tcx>)

Mark a machine allocation that was just created as immutable.
source§

fn float_to_int_checked( &self, src: &ImmTy<'tcx>, cast_to: TyAndLayout<'tcx>, round: Round, ) -> InterpResult<'tcx, Option<ImmTy<'tcx>>>

Converts src from floating point to integer type dest_ty after rounding with mode round. Returns None if f is NaN or out of range.
source§

fn get_twice_wide_int_ty(&self, ty: Ty<'tcx>) -> Ty<'tcx>

Returns an integer type that is twice wide as ty
source§

fn expect_target_feature_for_intrinsic( &self, intrinsic: Symbol, target_feature: &str, ) -> InterpResult<'tcx, ()>

Checks that target feature target_feature is enabled. Read more
Lookup an array of immediates stored as a linker section of name name.
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_atomic_intrinsic( &mut self, intrinsic_name: &str, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

Calls the atomic intrinsic intrinsic; the atomic_ prefix has already been removed. Returns Ok(true) if the intrinsic was handled.
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_simd_intrinsic( &mut self, intrinsic_name: &str, generic_args: GenericArgsRef<'tcx>, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

Calls the simd intrinsic intrinsic; the simd_ prefix has already been removed. Returns Ok(true) if the intrinsic was handled.
source§

fn fminmax_op( &self, op: MinMax, left: &ImmTy<'tcx>, right: &ImmTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn call_intrinsic( &mut self, instance: Instance<'tcx>, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ret: Option<BasicBlock>, unwind: UnwindAction, ) -> InterpResult<'tcx, Option<Instance<'tcx>>>

source§

fn emulate_intrinsic_by_name( &mut self, intrinsic_name: &str, generic_args: GenericArgsRef<'tcx>, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ret: Option<BasicBlock>, ) -> InterpResult<'tcx, EmulateItemResult>

Emulates a Miri-supported intrinsic (not supported by the core engine). Returns Ok(true) if the intrinsic was handled.
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn binary_ptr_op( &self, bin_op: BinOp, left: &ImmTy<'tcx>, right: &ImmTy<'tcx>, ) -> InterpResult<'tcx, ImmTy<'tcx>>

source§

fn generate_nan<F1: Float + FloatConvert<F2>, F2: Float>( &self, inputs: &[F1], ) -> F2

source§

fn adjust_nan<F1: Float + FloatConvert<F2>, F2: Float>( &self, f: F2, inputs: &[F1], ) -> F2

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn malloc_align(&self, size: u64) -> Align

Returns the alignment that malloc would guarantee for requests of the given size.
source§

fn emulate_allocator( &mut self, default: impl FnOnce(&mut MiriInterpCx<'tcx>) -> InterpResult<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

Emulates calling the internal _rust* allocator functions
source§

fn malloc(&mut self, size: u64, zero_init: bool) -> InterpResult<'tcx, Pointer>

source§

fn posix_memalign( &mut self, memptr: &OpTy<'tcx>, align: &OpTy<'tcx>, size: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn free(&mut self, ptr: Pointer) -> InterpResult<'tcx>

source§

fn realloc( &mut self, old_ptr: Pointer, new_size: u64, ) -> InterpResult<'tcx, Pointer>

source§

fn aligned_alloc( &mut self, align: &OpTy<'tcx>, size: &OpTy<'tcx>, ) -> InterpResult<'tcx, Pointer>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn handle_miri_backtrace_size( &mut self, abi: Abi, link_name: Symbol, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn handle_miri_get_backtrace( &mut self, abi: Abi, link_name: Symbol, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn resolve_frame_pointer( &mut self, ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, (Instance<'tcx>, Loc, String, String)>

source§

fn handle_miri_resolve_frame( &mut self, abi: Abi, link_name: Symbol, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn handle_miri_resolve_frame_names( &mut self, abi: Abi, link_name: Symbol, args: &[OpTy<'tcx>], ) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn call_native_fn( &mut self, link_name: Symbol, dest: &MPlaceTy<'tcx>, args: &[OpTy<'tcx>], ) -> InterpResult<'tcx, bool>

Call the native host function, with supplied arguments. Needs to convert all the arguments from their Miri representations to a native form (through libffi call). Then, convert the return value from the native form into something that can be stored in Miri’s internal memory.
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_foreign_item_inner( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn tb_retag_ptr_value( &mut self, kind: RetagKind, val: &ImmTy<'tcx>, ) -> InterpResult<'tcx, ImmTy<'tcx>>

Retag a pointer. References are passed to from_ref_ty and raw pointers are never reborrowed.
source§

fn tb_retag_place_contents( &mut self, kind: RetagKind, place: &PlaceTy<'tcx>, ) -> InterpResult<'tcx>

Retag all pointers that are stored in this place.
source§

fn tb_protect_place( &mut self, place: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, MPlaceTy<'tcx>>

Protect a place so that it cannot be used any more for the duration of the current function call. Read more
source§

fn tb_expose_tag( &mut self, alloc_id: AllocId, tag: BorTag, ) -> InterpResult<'tcx>

Mark the given tag as exposed. It was found on a pointer with the given AllocId.
source§

fn print_tree( &mut self, alloc_id: AllocId, show_unnamed: bool, ) -> InterpResult<'tcx>

Display the tree.
source§

fn tb_give_pointer_debug_name( &mut self, ptr: Pointer, nth_parent: u8, name: &str, ) -> InterpResult<'tcx>

Give a name to the pointer, usually the name it has in the source code (for debugging). The name given is name and the pointer that receives it is the nth_parent of ptr (with 0 representing ptr itself)
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn getenv(&mut self, name_op: &OpTy<'tcx>) -> InterpResult<'tcx, Pointer>

source§

fn setenv( &mut self, name_op: &OpTy<'tcx>, value_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn unsetenv(&mut self, name_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

fn getcwd( &mut self, buf_op: &OpTy<'tcx>, size_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Pointer>

source§

fn chdir(&mut self, path_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

fn update_environ(&mut self) -> InterpResult<'tcx>

Updates the environ static.
source§

fn getpid(&mut self) -> InterpResult<'tcx, Scalar>

source§

fn linux_gettid(&mut self) -> InterpResult<'tcx, Scalar>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn dup(&mut self, old_fd: i32) -> InterpResult<'tcx, Scalar>

source§

fn dup2(&mut self, old_fd: i32, new_fd: i32) -> InterpResult<'tcx, Scalar>

source§

fn flock(&mut self, fd: i32, op: i32) -> InterpResult<'tcx, Scalar>

source§

fn fcntl(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, Scalar>

source§

fn close(&mut self, fd_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

fn fd_not_found<T: From<i32>>(&mut self) -> InterpResult<'tcx, T>

Function used when a file descriptor does not exist. It returns Ok(-1)and sets the last OS error to libc::EBADF (invalid file descriptor). This function uses T: From<i32> instead of i32 directly because some fs functions return different integer types (like read, that returns an i64).
source§

fn read( &mut self, fd: i32, buf: Pointer, count: u64, offset: Option<i128>, ) -> InterpResult<'tcx, Scalar>

Read data from fd into buffer specified by buf and count. Read more
source§

fn write( &mut self, fd: i32, buf: Pointer, count: u64, offset: Option<i128>, ) -> InterpResult<'tcx, Scalar>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn open(&mut self, args: &[OpTy<'tcx>]) -> InterpResult<'tcx, Scalar>

source§

fn lseek64( &mut self, fd: i32, offset: i128, whence: i32, ) -> InterpResult<'tcx, Scalar>

source§

fn macos_fbsd_stat( &mut self, path_op: &OpTy<'tcx>, buf_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn macos_fbsd_lstat( &mut self, path_op: &OpTy<'tcx>, buf_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn macos_fbsd_fstat( &mut self, fd_op: &OpTy<'tcx>, buf_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn linux_statx( &mut self, dirfd_op: &OpTy<'tcx>, pathname_op: &OpTy<'tcx>, flags_op: &OpTy<'tcx>, mask_op: &OpTy<'tcx>, statxbuf_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn rename( &mut self, oldpath_op: &OpTy<'tcx>, newpath_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn mkdir( &mut self, path_op: &OpTy<'tcx>, mode_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn rmdir(&mut self, path_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

fn opendir(&mut self, name_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

fn linux_readdir64( &mut self, dirp_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn macos_fbsd_readdir_r( &mut self, dirp_op: &OpTy<'tcx>, entry_op: &OpTy<'tcx>, result_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn closedir(&mut self, dirp_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

fn ftruncate64(&mut self, fd: i32, length: i128) -> InterpResult<'tcx, Scalar>

source§

fn fsync(&mut self, fd_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

fn ffullsync_fd(&mut self, fd: i32) -> InterpResult<'tcx, Scalar>

source§

fn fdatasync(&mut self, fd_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

fn sync_file_range( &mut self, fd_op: &OpTy<'tcx>, offset_op: &OpTy<'tcx>, nbytes_op: &OpTy<'tcx>, flags_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn isatty(&mut self, miri_fd: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

fn realpath( &mut self, path_op: &OpTy<'tcx>, processed_path_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn mkstemp(&mut self, template_op: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn mmap( &mut self, addr: &OpTy<'tcx>, length: &OpTy<'tcx>, prot: &OpTy<'tcx>, flags: &OpTy<'tcx>, fd: &OpTy<'tcx>, offset: i128, ) -> InterpResult<'tcx, Scalar>

source§

fn munmap( &mut self, addr: &OpTy<'tcx>, length: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn pthread_mutexattr_init( &mut self, attr_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_mutexattr_settype( &mut self, attr_op: &OpTy<'tcx>, kind_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn pthread_mutexattr_destroy( &mut self, attr_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_mutex_init( &mut self, mutex_op: &OpTy<'tcx>, attr_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_mutex_lock( &mut self, mutex_op: &OpTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn pthread_mutex_trylock( &mut self, mutex_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn pthread_mutex_unlock( &mut self, mutex_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn pthread_mutex_destroy( &mut self, mutex_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_rwlock_rdlock( &mut self, rwlock_op: &OpTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn pthread_rwlock_tryrdlock( &mut self, rwlock_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn pthread_rwlock_wrlock( &mut self, rwlock_op: &OpTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn pthread_rwlock_trywrlock( &mut self, rwlock_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn pthread_rwlock_unlock( &mut self, rwlock_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_rwlock_destroy( &mut self, rwlock_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_condattr_init( &mut self, attr_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_condattr_setclock( &mut self, attr_op: &OpTy<'tcx>, clock_id_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn pthread_condattr_getclock( &mut self, attr_op: &OpTy<'tcx>, clk_id_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_condattr_destroy( &mut self, attr_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_cond_init( &mut self, cond_op: &OpTy<'tcx>, attr_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_cond_signal( &mut self, cond_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_cond_broadcast( &mut self, cond_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_cond_wait( &mut self, cond_op: &OpTy<'tcx>, mutex_op: &OpTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn pthread_cond_timedwait( &mut self, cond_op: &OpTy<'tcx>, mutex_op: &OpTy<'tcx>, abstime_op: &OpTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn pthread_cond_destroy( &mut self, cond_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn pthread_create( &mut self, thread: &OpTy<'tcx>, _attr: &OpTy<'tcx>, start_routine: &OpTy<'tcx>, arg: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_join( &mut self, thread: &OpTy<'tcx>, retval: &OpTy<'tcx>, ) -> InterpResult<'tcx, ()>

source§

fn pthread_detach(&mut self, thread: &OpTy<'tcx>) -> InterpResult<'tcx, ()>

source§

fn pthread_self(&mut self) -> InterpResult<'tcx, Scalar>

source§

fn pthread_setname_np( &mut self, thread: Scalar, name: Scalar, max_name_len: usize, ) -> InterpResult<'tcx, Scalar>

Set the name of the current thread. max_name_len is the maximal length of the name including the null terminator.
source§

fn pthread_getname_np( &mut self, thread: Scalar, name_out: Scalar, len: Scalar, ) -> InterpResult<'tcx, Scalar>

source§

fn sched_yield(&mut self) -> InterpResult<'tcx, ()>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn socketpair( &mut self, domain: &OpTy<'tcx>, type_: &OpTy<'tcx>, protocol: &OpTy<'tcx>, sv: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

For more information on the arguments see the socketpair manpage: https://linux.die.net/man/2/socketpair
source§

fn pipe2( &mut self, pipefd: &OpTy<'tcx>, flags: Option<&OpTy<'tcx>>, ) -> InterpResult<'tcx, Scalar>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_foreign_item_inner( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_foreign_item_inner( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn epoll_create1(&mut self, flags: &OpTy<'tcx>) -> InterpResult<'tcx, Scalar>

This function returns a file descriptor referring to the new Epoll instance. This file descriptor is used for all subsequent calls to the epoll interface. If the flags argument is 0, then this function is the same as epoll_create(). Read more
source§

fn epoll_ctl( &mut self, epfd: &OpTy<'tcx>, op: &OpTy<'tcx>, fd: &OpTy<'tcx>, event: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

This function performs control operations on the Epoll instance referred to by the file descriptor epfd. It requests that the operation op be performed for the target file descriptor, fd. Read more
source§

fn epoll_wait( &mut self, epfd: &OpTy<'tcx>, events_op: &OpTy<'tcx>, maxevents: &OpTy<'tcx>, timeout: &OpTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

The epoll_wait() system call waits for events on the Epoll instance referred to by the file descriptor epfd. The buffer pointed to by events is used to return information from the ready list about file descriptors in the interest list that have some events available. Up to maxevents are returned by epoll_wait(). The maxevents argument must be greater than zero. The timeout argument specifies the number of milliseconds that epoll_wait() will block. Time is measured against the CLOCK_MONOTONIC clock. If the timeout is zero, the function will not block, while if the timeout is -1, the function will block until at least one event has been retrieved (or an error occurred). A call to epoll_wait() will block until either: • a file descriptor delivers an event; • the call is interrupted by a signal handler; or • the timeout expires. Note that the timeout interval will be rounded up to the system clock granularity, and kernel scheduling delays mean that the blocking interval may overrun by a small amount. Specifying a timeout of -1 causes epoll_wait() to block indefinitely, while specifying a timeout equal to zero cause epoll_wait() to return immediately, even if no events are available. Read more
source§

fn check_and_update_readiness( &mut self, fd_ref: &FileDescriptionRef, ) -> InterpResult<'tcx, ()>

For a specific file description, get its ready events and update the corresponding ready list. This function should be called whenever an event causes more bytes or an EOF to become newly readable from an FD, and whenever more bytes can be written to an FD or no more future writes are possible. Read more
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn retag_ptr_value( &mut self, kind: RetagKind, val: &ImmTy<'tcx>, ) -> InterpResult<'tcx, ImmTy<'tcx>>

source§

fn retag_place_contents( &mut self, kind: RetagKind, place: &PlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn protect_place( &mut self, place: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, MPlaceTy<'tcx>>

source§

fn expose_tag(&mut self, alloc_id: AllocId, tag: BorTag) -> InterpResult<'tcx>

source§

fn give_pointer_debug_name( &mut self, ptr: Pointer, nth_parent: u8, name: &str, ) -> InterpResult<'tcx>

source§

fn print_borrow_state( &mut self, alloc_id: AllocId, show_unnamed: bool, ) -> InterpResult<'tcx>

source§

fn on_stack_pop( &self, frame: &Frame<'tcx, Provenance, FrameExtra<'tcx>>, ) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn eventfd( &mut self, val: &OpTy<'tcx>, flags: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

This function creates an Event that is used as an event wait/notify mechanism by user-space applications, and by the kernel to notify user-space applications of events. The Event contains an u64 counter maintained by the kernel. The counter is initialized with the value specified in the initval argument. Read more
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_foreign_item_inner( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn mremap( &mut self, old_address: &OpTy<'tcx>, old_size: &OpTy<'tcx>, new_size: &OpTy<'tcx>, flags: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_foreign_item_inner( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn os_unfair_lock_lock(&mut self, lock_op: &OpTy<'tcx>) -> InterpResult<'tcx>

source§

fn os_unfair_lock_trylock( &mut self, lock_op: &OpTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn os_unfair_lock_unlock(&mut self, lock_op: &OpTy<'tcx>) -> InterpResult<'tcx>

source§

fn os_unfair_lock_assert_owner( &mut self, lock_op: &OpTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn os_unfair_lock_assert_not_owner( &mut self, lock_op: &OpTy<'tcx>, ) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_foreign_item_inner( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_foreign_item_inner( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_foreign_item_inner( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn GetEnvironmentVariableW( &mut self, name_op: &OpTy<'tcx>, buf_op: &OpTy<'tcx>, size_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn GetEnvironmentStringsW(&mut self) -> InterpResult<'tcx, Pointer>

source§

fn FreeEnvironmentStringsW( &mut self, env_block_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn SetEnvironmentVariableW( &mut self, name_op: &OpTy<'tcx>, value_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn GetCurrentDirectoryW( &mut self, size_op: &OpTy<'tcx>, buf_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn SetCurrentDirectoryW( &mut self, path_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn GetCurrentProcessId(&mut self) -> InterpResult<'tcx, Scalar>

source§

fn GetUserProfileDirectoryW( &mut self, token: &OpTy<'tcx>, buf: &OpTy<'tcx>, size: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn invalid_handle(&mut self, function_name: &str) -> InterpResult<'tcx, !>

source§

fn CloseHandle(&mut self, handle_op: &OpTy<'tcx>) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

Evaluation context extensions.

source§

fn read_scalar_atomic( &self, place: &MPlaceTy<'tcx>, atomic: AtomicReadOrd, ) -> InterpResult<'tcx, Scalar>

Perform an atomic read operation at the memory location.
source§

fn write_scalar_atomic( &mut self, val: Scalar, dest: &MPlaceTy<'tcx>, atomic: AtomicWriteOrd, ) -> InterpResult<'tcx>

Perform an atomic write operation at the memory location.
source§

fn atomic_rmw_op_immediate( &mut self, place: &MPlaceTy<'tcx>, rhs: &ImmTy<'tcx>, op: BinOp, not: bool, atomic: AtomicRwOrd, ) -> InterpResult<'tcx, ImmTy<'tcx>>

Perform an atomic RMW operation on a memory location.
source§

fn atomic_exchange_scalar( &mut self, place: &MPlaceTy<'tcx>, new: Scalar, atomic: AtomicRwOrd, ) -> InterpResult<'tcx, Scalar>

Perform an atomic exchange with a memory place and a new scalar value, the old value is returned.
source§

fn atomic_min_max_scalar( &mut self, place: &MPlaceTy<'tcx>, rhs: ImmTy<'tcx>, min: bool, atomic: AtomicRwOrd, ) -> InterpResult<'tcx, ImmTy<'tcx>>

Perform an conditional atomic exchange with a memory place and a new scalar value, the old value is returned.
source§

fn atomic_compare_exchange_scalar( &mut self, place: &MPlaceTy<'tcx>, expect_old: &ImmTy<'tcx>, new: Scalar, success: AtomicRwOrd, fail: AtomicReadOrd, can_fail_spuriously: bool, ) -> InterpResult<'tcx, Immediate<Provenance>>

Perform an atomic compare and exchange at a given memory location. On success an atomic RMW operation is performed and on failure only an atomic read occurs. If can_fail_spuriously is true, then we treat it as a “compare_exchange_weak” operation, and some portion of the time fail even when the values are actually identical.
source§

fn atomic_fence(&mut self, atomic: AtomicFenceOrd) -> InterpResult<'tcx>

Update the data-race detector for an atomic fence on the current thread.
source§

fn allow_data_races_all_threads_done(&mut self)

After all threads are done running, this allows data races to occur for subsequent ‘administrative’ machine accesses (that logically happen outside of the Abstract Machine).
source§

fn release_clock<'a>(&'a self) -> Option<Ref<'a, VClock>>
where 'tcx: 'a,

Returns the release clock of the current thread. Other threads can acquire this clock in the future to establish synchronization with this program point.
source§

fn acquire_clock(&self, clock: &VClock)

Acquire the given clock into the current thread, establishing synchronization with the moment when that clock snapshot was taken via release_clock.
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn InitOnceBeginInitialize( &mut self, init_once_op: &OpTy<'tcx>, flags_op: &OpTy<'tcx>, pending_op: &OpTy<'tcx>, context_op: &OpTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn InitOnceComplete( &mut self, init_once_op: &OpTy<'tcx>, flags_op: &OpTy<'tcx>, context_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn WaitOnAddress( &mut self, ptr_op: &OpTy<'tcx>, compare_op: &OpTy<'tcx>, size_op: &OpTy<'tcx>, timeout_op: &OpTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn WakeByAddressSingle(&mut self, ptr_op: &OpTy<'tcx>) -> InterpResult<'tcx>

source§

fn WakeByAddressAll(&mut self, ptr_op: &OpTy<'tcx>) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn CreateThread( &mut self, security_op: &OpTy<'tcx>, stacksize_op: &OpTy<'tcx>, start_op: &OpTy<'tcx>, arg_op: &OpTy<'tcx>, flags_op: &OpTy<'tcx>, thread_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, ThreadId>

source§

fn WaitForSingleObject( &mut self, handle_op: &OpTy<'tcx>, timeout_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, u32>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_aesni_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_avx_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_avx2_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_bmi_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_sha_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_sse_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_sse2_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_sse3_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn init_once_get_or_create_id( &mut self, lock_op: &OpTy<'tcx>, lock_layout: TyAndLayout<'tcx>, offset: u64, ) -> InterpResult<'tcx, InitOnceId>

source§

fn init_once_status(&mut self, id: InitOnceId) -> InitOnceStatus

source§

fn init_once_enqueue_and_block( &mut self, id: InitOnceId, callback: impl UnblockCallback<'tcx> + 'tcx, )

Put the thread into the queue waiting for the initialization.
source§

fn init_once_begin(&mut self, id: InitOnceId)

Begin initializing this InitOnce. Must only be called after checking that it is currently uninitialized.
source§

fn init_once_complete(&mut self, id: InitOnceId) -> InterpResult<'tcx>

source§

fn init_once_fail(&mut self, id: InitOnceId) -> InterpResult<'tcx>

source§

fn init_once_observe_completed(&mut self, id: InitOnceId)

Synchronize with the previous completion of an InitOnce. Must only be called after checking that it is complete.
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_sse41_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_sse42_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_ssse3_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_x86_intrinsic( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn get_env_var(&mut self, name: &OsStr) -> InterpResult<'tcx, Option<OsString>>

Try to get an environment variable from the interpreted program’s environment. This is useful for implementing shims which are documented to read from the environment.
source§

fn get_pid(&self) -> u32

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emulate_foreign_item( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ret: Option<BasicBlock>, unwind: UnwindAction, ) -> InterpResult<'tcx, Option<(&'tcx Body<'tcx>, Instance<'tcx>)>>

Emulates calling a foreign item, failing if the item is not supported. This function will handle goto_block if needed. Returns Ok(None) if the foreign item was completely handled by this function. Returns Ok(Some(body)) if processing the foreign item is delegated to another function.
source§

fn is_dyn_sym(&self, name: &str) -> bool

source§

fn emulate_dyn_sym( &mut self, sym: DynSym, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ret: Option<BasicBlock>, unwind: UnwindAction, ) -> InterpResult<'tcx>

Emulates a call to a DynSym.
source§

fn lookup_exported_symbol( &mut self, link_name: Symbol, ) -> InterpResult<'tcx, Option<(&'tcx Body<'tcx>, Instance<'tcx>)>>

Lookup the body of a function that has link_name as the symbol name.
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn read_os_str_from_c_str<'a>( &'a self, ptr: Pointer, ) -> InterpResult<'tcx, &'a OsStr>
where 'tcx: 'a,

Helper function to read an OsString from a null-terminated sequence of bytes, which is what the Unix APIs usually handle.
source§

fn read_os_str_from_wide_str<'a>( &'a self, ptr: Pointer, ) -> InterpResult<'tcx, OsString>
where 'tcx: 'a,

Helper function to read an OsString from a 0x0000-terminated sequence of u16, which is what the Windows APIs usually handle.
source§

fn write_os_str_to_c_str( &mut self, os_str: &OsStr, ptr: Pointer, size: u64, ) -> InterpResult<'tcx, (bool, u64)>

Helper function to write an OsStr as a null-terminated sequence of bytes, which is what the Unix APIs usually handle. Returns (success, full_len), where length includes the null terminator. On failure, nothing is written.
source§

fn write_os_str_to_wide_str_helper( &mut self, os_str: &OsStr, ptr: Pointer, size: u64, truncate: bool, ) -> InterpResult<'tcx, (bool, u64)>

Internal helper to share code between write_os_str_to_wide_str and write_os_str_to_wide_str_truncated.
source§

fn write_os_str_to_wide_str( &mut self, os_str: &OsStr, ptr: Pointer, size: u64, ) -> InterpResult<'tcx, (bool, u64)>

Helper function to write an OsStr as a 0x0000-terminated u16-sequence, which is what the Windows APIs usually handle. Returns (success, full_len), where length is measured in units of u16 and includes the null terminator. On failure, nothing is written.
source§

fn write_os_str_to_wide_str_truncated( &mut self, os_str: &OsStr, ptr: Pointer, size: u64, ) -> InterpResult<'tcx, (bool, u64)>

Like write_os_str_to_wide_str, but on failure as much as possible is written into the buffer (always with a null terminator).
source§

fn alloc_os_str_as_c_str( &mut self, os_str: &OsStr, memkind: MemoryKind, ) -> InterpResult<'tcx, Pointer>

Allocate enough memory to store the given OsStr as a null-terminated sequence of bytes.
source§

fn alloc_os_str_as_wide_str( &mut self, os_str: &OsStr, memkind: MemoryKind, ) -> InterpResult<'tcx, Pointer>

Allocate enough memory to store the given OsStr as a null-terminated sequence of u16.
source§

fn read_path_from_c_str<'a>( &'a self, ptr: Pointer, ) -> InterpResult<'tcx, Cow<'a, Path>>
where 'tcx: 'a,

Read a null-terminated sequence of bytes, and perform path separator conversion if needed.
source§

fn read_path_from_wide_str(&self, ptr: Pointer) -> InterpResult<'tcx, PathBuf>

Read a null-terminated sequence of u16s, and perform path separator conversion if needed.
source§

fn write_path_to_c_str( &mut self, path: &Path, ptr: Pointer, size: u64, ) -> InterpResult<'tcx, (bool, u64)>

Write a Path to the machine memory (as a null-terminated sequence of bytes), adjusting path separators if needed.
source§

fn write_path_to_wide_str( &mut self, path: &Path, ptr: Pointer, size: u64, ) -> InterpResult<'tcx, (bool, u64)>

Write a Path to the machine memory (as a null-terminated sequence of u16s), adjusting path separators if needed.
source§

fn write_path_to_wide_str_truncated( &mut self, path: &Path, ptr: Pointer, size: u64, ) -> InterpResult<'tcx, (bool, u64)>

Write a Path to the machine memory (as a null-terminated sequence of u16s), adjusting path separators if needed.
source§

fn alloc_path_as_c_str( &mut self, path: &Path, memkind: MemoryKind, ) -> InterpResult<'tcx, Pointer>

Allocate enough memory to store a Path as a null-terminated sequence of bytes, adjusting path separators if needed.
source§

fn alloc_path_as_wide_str( &mut self, path: &Path, memkind: MemoryKind, ) -> InterpResult<'tcx, Pointer>

Allocate enough memory to store a Path as a null-terminated sequence of u16s, adjusting path separators if needed.
source§

fn convert_path<'a>( &self, os_str: Cow<'a, OsStr>, direction: PathConversion, ) -> Cow<'a, OsStr>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn handle_miri_start_unwind( &mut self, payload: &OpTy<'tcx>, ) -> InterpResult<'tcx>

Handles the special miri_start_unwind intrinsic, which is called by libpanic_unwind to delegate the actual unwinding process to Miri.
source§

fn handle_catch_unwind( &mut self, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ret: Option<BasicBlock>, ) -> InterpResult<'tcx>

Handles the try intrinsic, the underlying implementation of std::panicking::try.
source§

fn handle_stack_pop_unwind( &mut self, extra: FrameExtra<'tcx>, unwinding: bool, ) -> InterpResult<'tcx, ReturnAction>

source§

fn start_panic(&mut self, msg: &str, unwind: UnwindAction) -> InterpResult<'tcx>

Start a panic in the interpreter with the given message as payload.
source§

fn start_panic_nounwind(&mut self, msg: &str) -> InterpResult<'tcx>

Start a non-unwinding panic in the interpreter with the given message as payload.
source§

fn assert_panic( &mut self, msg: &AssertMessage<'tcx>, unwind: UnwindAction, ) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn clock_gettime( &mut self, clk_id_op: &OpTy<'tcx>, tp_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn gettimeofday( &mut self, tv_op: &OpTy<'tcx>, tz_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn localtime_r( &mut self, timep: &OpTy<'tcx>, result_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Pointer>

source§

fn GetSystemTimeAsFileTime( &mut self, shim_name: &str, LPFILETIME_op: &OpTy<'tcx>, ) -> InterpResult<'tcx>

source§

fn QueryPerformanceCounter( &mut self, lpPerformanceCount_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn QueryPerformanceFrequency( &mut self, lpFrequency_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn mach_absolute_time(&self) -> InterpResult<'tcx, Scalar>

source§

fn mach_timebase_info( &mut self, info_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn nanosleep( &mut self, req_op: &OpTy<'tcx>, _rem: &OpTy<'tcx>, ) -> InterpResult<'tcx, Scalar>

source§

fn Sleep(&mut self, timeout: &OpTy<'tcx>) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn mutex_get_or_create_id( &mut self, lock_op: &OpTy<'tcx>, lock_layout: TyAndLayout<'tcx>, offset: u64, ) -> InterpResult<'tcx, MutexId>

source§

fn rwlock_get_or_create_id( &mut self, lock_op: &OpTy<'tcx>, lock_layout: TyAndLayout<'tcx>, offset: u64, ) -> InterpResult<'tcx, RwLockId>

source§

fn condvar_get_or_create_id( &mut self, lock_op: &OpTy<'tcx>, lock_layout: TyAndLayout<'tcx>, offset: u64, ) -> InterpResult<'tcx, CondvarId>

source§

fn mutex_get_owner(&mut self, id: MutexId) -> ThreadId

Get the id of the thread that currently owns this lock.
source§

fn mutex_is_locked(&self, id: MutexId) -> bool

Check if locked.
source§

fn mutex_lock(&mut self, id: MutexId)

Lock by setting the mutex owner and increasing the lock count.
source§

fn mutex_unlock(&mut self, id: MutexId) -> InterpResult<'tcx, Option<usize>>

Try unlocking by decreasing the lock count and returning the old lock count. If the lock count reaches 0, release the lock and potentially give to a new owner. If the lock was not locked by the current thread, return None.
source§

fn mutex_enqueue_and_block( &mut self, id: MutexId, retval_dest: Option<(Scalar, MPlaceTy<'tcx>)>, )

Put the thread into the queue waiting for the mutex. Read more
source§

fn rwlock_is_locked(&self, id: RwLockId) -> bool

Check if locked.
source§

fn rwlock_is_write_locked(&self, id: RwLockId) -> bool

Check if write locked.
source§

fn rwlock_reader_lock(&mut self, id: RwLockId)

Read-lock the lock by adding the reader the list of threads that own this lock.
source§

fn rwlock_reader_unlock(&mut self, id: RwLockId) -> InterpResult<'tcx, bool>

Try read-unlock the lock for the current threads and potentially give the lock to a new owner. Returns true if succeeded, false if this reader did not hold the lock.
source§

fn rwlock_enqueue_and_block_reader( &mut self, id: RwLockId, retval: Scalar, dest: MPlaceTy<'tcx>, )

Put the reader in the queue waiting for the lock and block it. Once the lock becomes available, retval will be written to dest.
source§

fn rwlock_writer_lock(&mut self, id: RwLockId)

Lock by setting the writer that owns the lock.
source§

fn rwlock_writer_unlock(&mut self, id: RwLockId) -> InterpResult<'tcx, bool>

Try to unlock an rwlock held by the current thread. Return false if it is held by another thread.
source§

fn rwlock_enqueue_and_block_writer( &mut self, id: RwLockId, retval: Scalar, dest: MPlaceTy<'tcx>, )

Put the writer in the queue waiting for the lock. Once the lock becomes available, retval will be written to dest.
source§

fn condvar_is_awaited(&mut self, id: CondvarId) -> bool

Is the conditional variable awaited?
source§

fn condvar_wait( &mut self, condvar: CondvarId, mutex: MutexId, timeout: Option<(TimeoutClock, TimeoutAnchor, Duration)>, retval_succ: Scalar, retval_timeout: Scalar, dest: MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

Release the mutex and let the current thread wait on the given condition variable. Once it is signaled, the mutex will be acquired and retval_succ will be written to dest. If the timeout happens first, retval_timeout will be written to dest.
source§

fn condvar_signal(&mut self, id: CondvarId) -> InterpResult<'tcx, bool>

Wake up some thread (if there is any) sleeping on the conditional variable. Returns true iff any thread was woken up.
source§

fn futex_wait( &mut self, addr: u64, bitset: u32, timeout: Option<(TimeoutClock, TimeoutAnchor, Duration)>, retval_succ: Scalar, retval_timeout: Scalar, dest: MPlaceTy<'tcx>, errno_timeout: Scalar, )

Wait for the futex to be signaled, or a timeout. On a signal, retval_succ is written to dest. On a timeout, retval_timeout is written to dest and errno_timeout is set as the last error.
source§

fn futex_wake(&mut self, addr: u64, bitset: u32) -> InterpResult<'tcx, bool>

Returns whether anything was woken.
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn get_or_create_thread_local_alloc( &mut self, def_id: DefId, ) -> InterpResult<'tcx, StrictPointer>

Get a thread-specific allocation id for the given thread-local static. If needed, allocate a new one.
source§

fn start_regular_thread( &mut self, thread: Option<MPlaceTy<'tcx>>, start_routine: Pointer, start_abi: Abi, func_arg: ImmTy<'tcx>, ret_layout: TyAndLayout<'tcx>, ) -> InterpResult<'tcx, ThreadId>

Start a regular (non-main) thread.
source§

fn terminate_active_thread( &mut self, tls_alloc_action: TlsAllocAction, ) -> InterpResult<'tcx>

Handles thread termination of the active thread: wakes up threads joining on this one, and deals with the thread’s thread-local statics according to tls_alloc_action. Read more
source§

fn block_thread( &mut self, reason: BlockReason, timeout: Option<(TimeoutClock, TimeoutAnchor, Duration)>, callback: impl UnblockCallback<'tcx> + 'tcx, )

Block the current thread, with an optional timeout. The callback will be invoked when the thread gets unblocked.
source§

fn unblock_thread( &mut self, thread: ThreadId, reason: BlockReason, ) -> InterpResult<'tcx>

Put the blocked thread into the enabled state. Sanity-checks that the thread previously was blocked for the right reason.
source§

fn detach_thread( &mut self, thread_id: ThreadId, allow_terminated_joined: bool, ) -> InterpResult<'tcx>

source§

fn join_thread(&mut self, joined_thread_id: ThreadId) -> InterpResult<'tcx>

source§

fn join_thread_exclusive( &mut self, joined_thread_id: ThreadId, ) -> InterpResult<'tcx>

source§

fn active_thread(&self) -> ThreadId

source§

fn active_thread_mut(&mut self) -> &mut Thread<'tcx>

source§

fn active_thread_ref(&self) -> &Thread<'tcx>

source§

fn get_total_thread_count(&self) -> usize

source§

fn have_all_terminated(&self) -> bool

source§

fn enable_thread(&mut self, thread_id: ThreadId)

source§

fn active_thread_stack<'a>( &'a self, ) -> &'a [Frame<'tcx, Provenance, FrameExtra<'tcx>>]

source§

fn active_thread_stack_mut<'a>( &'a mut self, ) -> &'a mut Vec<Frame<'tcx, Provenance, FrameExtra<'tcx>>>

source§

fn set_thread_name(&mut self, thread: ThreadId, new_thread_name: Vec<u8>)

Set the name of the current thread. The buffer must not include the null terminator.
source§

fn get_thread_name<'c>(&'c self, thread: ThreadId) -> Option<&'c [u8]>
where 'tcx: 'c,

source§

fn yield_active_thread(&mut self)

source§

fn maybe_preempt_active_thread(&mut self)

source§

fn run_threads(&mut self) -> InterpResult<'tcx, !>

Run the core interpreter loop. Returns only when an interrupt occurs (an error or program termination).
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn buffered_atomic_rmw( &mut self, new_val: Scalar, place: &MPlaceTy<'tcx>, atomic: AtomicRwOrd, init: Scalar, ) -> InterpResult<'tcx>

source§

fn buffered_atomic_read( &self, place: &MPlaceTy<'tcx>, atomic: AtomicReadOrd, latest_in_mo: Scalar, validate: impl FnOnce() -> InterpResult<'tcx>, ) -> InterpResult<'tcx, Option<Scalar>>

source§

fn buffered_atomic_write( &mut self, val: Scalar, dest: &MPlaceTy<'tcx>, atomic: AtomicWriteOrd, init: Option<Scalar>, ) -> InterpResult<'tcx>

Add the given write to the store buffer. (Does not change machine memory.) Read more
source§

fn perform_read_on_buffered_latest( &self, place: &MPlaceTy<'tcx>, atomic: AtomicReadOrd, ) -> InterpResult<'tcx>

Caller should never need to consult the store buffer for the latest value. This function is used exclusively for failed atomic_compare_exchange_scalar to perform load_impl on the latest store element
source§

impl<'tcx> EvalContextExt<'tcx> for MiriInterpCx<'tcx>

source§

fn emit_diagnostic(&self, e: NonHaltingDiagnostic)

source§

fn handle_ice(&self)

We had a panic in Miri itself, try to print something useful.
source§

impl<'tcx> EvalContextExtPriv<'tcx> for MiriInterpCx<'tcx>

source§

fn alloc_id_from_addr(&self, addr: u64, size: i64) -> Option<AllocId>

source§

fn addr_from_alloc_id( &self, alloc_id: AllocId, memory_kind: MemoryKind, ) -> InterpResult<'tcx, u64>

source§

impl<'tcx> EvalContextExtPriv<'tcx> for MiriInterpCx<'tcx>

source§

fn get_or_create_id<Id: SyncId + Idx, T: Default>( &mut self, lock_op: &OpTy<'tcx>, lock_layout: TyAndLayout<'tcx>, offset: u64, get_objs: impl for<'a> Fn(&'a mut MiriInterpCx<'tcx>) -> &'a mut IndexVec<Id, T>, ) -> InterpResult<'tcx, Option<Id>>

Lazily initialize the ID of this Miri sync structure. If memory stores ‘0’, that indicates uninit and we generate a new instance. Returns None if memory stores a non-zero invalid ID. Read more
source§

fn condvar_reacquire_mutex( &mut self, mutex: MutexId, retval: Scalar, dest: MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextExtPriv<'tcx> for MiriInterpCx<'tcx>

source§

fn call_native_with_args<'a>( &mut self, link_name: Symbol, dest: &MPlaceTy<'tcx>, ptr: CodePtr, libffi_args: Vec<Arg<'a>>, ) -> InterpResult<'tcx, ImmTy<'tcx>>

Call native host function and return the output as an immediate.
source§

fn get_func_ptr_explicitly_from_lib( &mut self, link_name: Symbol, ) -> Option<CodePtr>

Get the pointer to the function of the specified name in the shared object file, if it exists. The function must be in the shared object file specified: we do not return pointers to functions in dependencies of the library.
source§

impl<'tcx> EvalContextExtPriv<'tcx> for MiriInterpCx<'tcx>

source§

fn os_unfair_lock_getid( &mut self, lock_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, MutexId>

source§

impl<'tcx> EvalContextExtPriv<'tcx> for MiriInterpCx<'tcx>

source§

fn init_once_get_id( &mut self, init_once_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, InitOnceId>

source§

fn init_once_try_begin( &mut self, id: InitOnceId, pending_place: &MPlaceTy<'tcx>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, bool>

Returns true if we were succssful, false if we would block.
source§

impl<'tcx> EvalContextExtPriv<'tcx> for MiriInterpCx<'tcx>

source§

fn check_rustc_alloc_request(&self, size: u64, align: u64) -> InterpResult<'tcx>

Check some basic requirements for this allocation request: non-zero size, power-of-two alignment.
source§

fn emulate_foreign_item_inner( &mut self, link_name: Symbol, abi: Abi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

source§

impl<'tcx> EvalContextExtPrivate<'tcx> for MiriInterpCx<'tcx>

source§

fn macos_stat_write_buf( &mut self, metadata: FileMetadata, buf_op: &OpTy<'tcx>, ) -> InterpResult<'tcx, i32>

source§

fn file_type_to_d_type( &mut self, file_type: Result<FileType>, ) -> InterpResult<'tcx, i32>

source§

impl<'tcx> EvalContextPrivExt<'tcx> for MiriInterpCx<'tcx>

Retagging/reborrowing. Policy on which permission to grant to each pointer should be left to the implementation of NewPermission.

source§

fn tb_reborrow( &mut self, place: &MPlaceTy<'tcx>, ptr_size: Size, new_perm: NewPermission, new_tag: BorTag, ) -> InterpResult<'tcx, Option<Provenance>>

Returns the provenance that should be used henceforth.
source§

fn tb_retag_place( &mut self, place: &MPlaceTy<'tcx>, new_perm: NewPermission, ) -> InterpResult<'tcx, MPlaceTy<'tcx>>

source§

fn tb_retag_reference( &mut self, val: &ImmTy<'tcx>, new_perm: NewPermission, ) -> InterpResult<'tcx, ImmTy<'tcx>>

Retags an individual pointer, returning the retagged version.
source§

impl<'tcx> EvalContextPrivExt<'tcx> for MiriInterpCx<'tcx>

source§

fn allow_data_races_ref<R>( &self, op: impl FnOnce(&MiriInterpCx<'tcx>) -> R, ) -> R

Temporarily allow data-races to occur. This should only be used in one of these cases: Read more
source§

fn allow_data_races_mut<R>( &mut self, op: impl FnOnce(&mut MiriInterpCx<'tcx>) -> R, ) -> R

Same as allow_data_races_ref, this temporarily disables any data-race detection and so should only be used for atomic operations or internal state that the program cannot access.
source§

fn atomic_access_check( &self, place: &MPlaceTy<'tcx>, access_type: AtomicAccessType, ) -> InterpResult<'tcx>

Checks that an atomic access is legal at the given place.
source§

fn validate_atomic_load( &self, place: &MPlaceTy<'tcx>, atomic: AtomicReadOrd, ) -> InterpResult<'tcx>

Update the data-race detector for an atomic read occurring at the associated memory-place and on the current thread.
source§

fn validate_atomic_store( &mut self, place: &MPlaceTy<'tcx>, atomic: AtomicWriteOrd, ) -> InterpResult<'tcx>

Update the data-race detector for an atomic write occurring at the associated memory-place and on the current thread.
source§

fn validate_atomic_rmw( &mut self, place: &MPlaceTy<'tcx>, atomic: AtomicRwOrd, ) -> InterpResult<'tcx>

Update the data-race detector for an atomic read-modify-write occurring at the associated memory place and on the current thread.
source§

fn validate_atomic_op<A: Debug + Copy>( &self, place: &MPlaceTy<'tcx>, atomic: A, access: AccessType, op: impl FnMut(&mut MemoryCellClocks, &mut ThreadClockSet, VectorIdx, A) -> Result<(), DataRace>, ) -> InterpResult<'tcx>

Generic atomic operation implementation
source§

impl<'tcx> EvalContextPrivExt<'tcx> for MiriInterpCx<'tcx>

source§

fn run_timeout_callback(&mut self) -> InterpResult<'tcx>

Execute a timeout callback on the callback’s thread.
source§

fn run_on_stack_empty(&mut self) -> InterpResult<'tcx, Poll<()>>

source§

impl<'tcx> EvalContextPrivExt<'tcx> for MiriInterpCx<'tcx>

source§

fn atomic_load( &mut self, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, atomic: AtomicReadOrd, ) -> InterpResult<'tcx>

source§

fn atomic_store( &mut self, args: &[OpTy<'tcx>], atomic: AtomicWriteOrd, ) -> InterpResult<'tcx>

source§

fn compiler_fence_intrinsic( &mut self, args: &[OpTy<'tcx>], atomic: AtomicFenceOrd, ) -> InterpResult<'tcx>

source§

fn atomic_fence_intrinsic( &mut self, args: &[OpTy<'tcx>], atomic: AtomicFenceOrd, ) -> InterpResult<'tcx>

source§

fn atomic_rmw_op( &mut self, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, atomic_op: AtomicOp, atomic: AtomicRwOrd, ) -> InterpResult<'tcx>

source§

fn atomic_exchange( &mut self, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, atomic: AtomicRwOrd, ) -> InterpResult<'tcx>

source§

fn atomic_compare_exchange_impl( &mut self, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, success: AtomicRwOrd, fail: AtomicReadOrd, can_fail_spuriously: bool, ) -> InterpResult<'tcx>

source§

fn atomic_compare_exchange( &mut self, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, success: AtomicRwOrd, fail: AtomicReadOrd, ) -> InterpResult<'tcx>

source§

fn atomic_compare_exchange_weak( &mut self, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, success: AtomicRwOrd, fail: AtomicReadOrd, ) -> InterpResult<'tcx>

source§

impl<'tcx> EvalContextPrivExt<'tcx> for MiriInterpCx<'tcx>

source§

fn lookup_windows_tls_dtors(&mut self) -> InterpResult<'tcx, Vec<ImmTy<'tcx>>>

Schedule TLS destructors for Windows. On windows, TLS destructors are managed by std.
source§

fn schedule_windows_tls_dtor(&mut self, dtor: ImmTy<'tcx>) -> InterpResult<'tcx>

source§

fn schedule_macos_tls_dtor(&mut self) -> InterpResult<'tcx, Poll<()>>

Schedule the macOS thread local storage destructors to be executed.
source§

fn schedule_next_pthread_tls_dtor( &mut self, state: &mut RunningDtorState, ) -> InterpResult<'tcx, Poll<()>>

Schedule a pthread TLS destructor. Returns true if found a destructor to schedule, and false otherwise.
source§

impl<'tcx, 'ecx> EvalContextPrivExt<'tcx, 'ecx> for MiriInterpCx<'tcx>

Retagging/reborrowing. There is some policy in here, such as which permissions to grant for which references, and when to add protectors.

source§

fn sb_reborrow( &mut self, place: &MPlaceTy<'tcx>, size: Size, new_perm: NewPermission, new_tag: BorTag, retag_info: RetagInfo, ) -> InterpResult<'tcx, Option<Provenance>>

Returns the provenance that should be used henceforth.
source§

fn sb_retag_place( &mut self, place: &MPlaceTy<'tcx>, new_perm: NewPermission, info: RetagInfo, ) -> InterpResult<'tcx, MPlaceTy<'tcx>>

source§

fn sb_retag_reference( &mut self, val: &ImmTy<'tcx>, new_perm: NewPermission, info: RetagInfo, ) -> InterpResult<'tcx, ImmTy<'tcx>>

Retags an individual pointer, returning the retagged version. kind indicates what kind of reference is being created.
source§

impl<'tcx> MiriInterpCxExt<'tcx> for MiriInterpCx<'tcx>

source§

fn eval_context_ref(&self) -> &MiriInterpCx<'tcx>

source§

fn eval_context_mut(&mut self) -> &mut MiriInterpCx<'tcx>

source§

impl VisitProvenance for MiriInterpCx<'_>

source§

fn visit_provenance(&self, visit: &mut VisitWith<'_>)

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 2608 bytes