miri

Type Alias 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]) -> MPlaceTy<'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: ExternAbi, 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 deref_pointer_as( &self, op: &impl Projectable<'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 Projectable<'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 Projectable<'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 Projectable<'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: ExternAbi, exp_abi: ExternAbi, ) -> InterpResult<'a, ()>

Check that the ABI is what we expect.
Source§

fn frame_in_std(&self) -> bool

Source§

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

Source§

fn check_shim<'a, const N: usize>( &mut self, abi: ExternAbi, exp_abi: ExternAbi, 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§

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: ExternAbi, link_name: Symbol, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

Source§

fn handle_miri_get_backtrace( &mut self, abi: ExternAbi, 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: ExternAbi, link_name: Symbol, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

Source§

fn handle_miri_resolve_frame_names( &mut self, abi: ExternAbi, 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: ExternAbi, 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_num: i32) -> InterpResult<'tcx, Scalar>

Source§

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

Source§

fn flock(&mut self, fd_num: 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 read( &mut self, fd_num: i32, buf: Pointer, count: u64, offset: Option<i128>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

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

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

Source§

fn return_read_success( &mut self, buf: Pointer, bytes: &[u8], actual_read_size: usize, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

Helper to implement FileDescription::read: This is only used when read is successful. actual_read_size should be the return value of some underlying read call that used bytes as its output buffer. The length of bytes must not exceed either the host’s or the target’s isize. bytes is written to buf and the size is written to dest.
Source§

fn return_write_success( &mut self, actual_write_size: usize, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

Helper to implement FileDescription::write: This function is only used when write is successful, and writes actual_write_size to dest
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_num: 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_num: 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_num: 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, Scalar>

Source§

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

Source§

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

Source§

fn pthread_setname_np( &mut self, thread: Scalar, name: Scalar, name_max_len: usize, truncate: bool, ) -> InterpResult<'tcx, ThreadNameResult>

Set the name of the specified thread. If the name including the null terminator is longer or equals to name_max_len, then if truncate is set the truncated name is used as the thread name, otherwise ThreadNameResult::NameTooLong is returned. If the specified thread wasn’t found, ThreadNameResult::ThreadNotFound is returned.
Source§

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

Get the name of the specified thread. If the thread name doesn’t fit the buffer, then if truncate is set the truncated name is written out, otherwise ThreadNameResult::NameTooLong is returned. If the specified thread wasn’t found, ThreadNameResult::ThreadNotFound is returned.
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: ExternAbi, 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: ExternAbi, 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. 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: ExternAbi, 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: ExternAbi, 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: ExternAbi, 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: ExternAbi, 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: ExternAbi, 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, Scalar>

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<R>(&self, callback: impl FnOnce(&VClock) -> R) -> Option<R>

Calls the callback with the “release” clock of the current thread. Other threads can acquire this clock in the future to establish synchronization with this program point. Read more
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, Scalar>

Source§

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

Source§

fn emulate_x86_aesni_intrinsic( &mut self, link_name: Symbol, abi: ExternAbi, 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: ExternAbi, 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: ExternAbi, 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: ExternAbi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

Source§

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

Source§

fn emulate_x86_gfni_intrinsic( &mut self, link_name: Symbol, abi: ExternAbi, 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: ExternAbi, 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: ExternAbi, 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: ExternAbi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

Source§

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

Source§

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

Source§

fn init_once_enqueue_and_block( &mut self, id: InitOnceId, callback: Box<dyn 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_sse3_intrinsic( &mut self, link_name: Symbol, abi: ExternAbi, args: &[OpTy<'tcx>], dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx, EmulateItemResult>

Source§

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

Source§

fn emulate_x86_sse41_intrinsic( &mut self, link_name: Symbol, abi: ExternAbi, 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: ExternAbi, 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: ExternAbi, 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: ExternAbi, 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: ExternAbi, 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: ExternAbi, 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 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, err: impl Into<IoError>) -> InterpResult<'tcx>

Sets the last error variable.
Source§

fn set_last_error_and_return( &mut self, err: impl Into<IoError>, dest: &MPlaceTy<'tcx>, ) -> InterpResult<'tcx>

Sets the last OS error and writes -1 to dest place.
Source§

fn set_last_error_and_return_i32( &mut self, err: impl Into<IoError>, ) -> InterpResult<'tcx, Scalar>

Sets the last OS error and return -1 as a i32-typed Scalar
Source§

fn set_last_error_and_return_i64( &mut self, err: impl Into<IoError>, ) -> InterpResult<'tcx, Scalar>

Sets the last OS error and return -1 as a i64-typed Scalar
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 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§

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 lazy_sync_init<T: 'static + Copy>( &mut self, primitive: &MPlaceTy<'tcx>, init_offset: Size, data: T, ) -> InterpResult<'tcx>

Helper for lazily initialized alloc_extra.sync data: this forces an immediate init.
Source§

fn lazy_sync_get_data<T: 'static + Copy>( &mut self, primitive: &MPlaceTy<'tcx>, init_offset: Size, missing_data: impl FnOnce() -> InterpResult<'tcx, T>, new_data: impl FnOnce(&mut MiriInterpCx<'tcx>) -> InterpResult<'tcx, T>, ) -> InterpResult<'tcx, T>

Helper for lazily initialized alloc_extra.sync data: Checks if the primitive is initialized: Read more
Source§

fn get_sync_or_init<'a, T: 'static>( &'a mut self, ptr: Pointer, new: impl FnOnce(&'a mut MiriMachine<'tcx>) -> T, ) -> Option<&'a T>
where 'tcx: 'a,

Get the synchronization primitive associated with the given pointer, or initialize a new one. Read more
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, futex_ref: FutexRef, bitset: u32, timeout: Option<(TimeoutClock, TimeoutAnchor, Duration)>, retval_succ: Scalar, retval_timeout: Scalar, dest: MPlaceTy<'tcx>, errno_timeout: IoError, )

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, futex_ref: &FutexRef, bitset: u32, ) -> InterpResult<'tcx, bool>

Wake up the first thread in the queue that matches any of the bits in the bitset. Returns whether anything was woken.
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 thread_id_try_from( &self, id: impl TryInto<u32>, ) -> Result<ThreadId, ThreadNotFound>

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: ExternAbi, 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: Box<dyn 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_uncached( &self, global_state: &mut GlobalStateInner, alloc_id: AllocId, memory_kind: MemoryKind, ) -> InterpResult<'tcx, u64>

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 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_get_data( &mut self, lock_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, MacOsUnfairLock>

Source§

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

Source§

fn init_once_get_data( &mut self, init_once_ptr: &OpTy<'tcx>, ) -> InterpResult<'tcx, WindowsInitOnce>

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: ExternAbi, 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: 2624 bytes