pub(crate) struct VmExecutor<'z3, 'tcx> {
target_def_id: DefId,
instantiated_target_body: Option<&'tcx Body<'tcx>>,
pub(crate) z3_ctx: &'z3 Context,
pub(crate) tcx: TyCtxt<'tcx>,
constructor_mir_mode: ConstructorMirMode,
path_state: VmState<'z3, 'tcx>,
}Expand description
Executes MIR using an immutable context and a path-local symbolic state.
§Agent Rules
Do not add new fields without human approval.
Fields§
§target_def_id: DefIdFunction being verified, retained while inlined callee frames execute.
instantiated_target_body: Option<&'tcx Body<'tcx>>Target MIR instantiated with a selected trait-bound implementor when an
unresolved, unmodeled generic trait call needs a concrete method target.
None uses the original optimized MIR, even for generic functions.
z3_ctx: &'z3 ContextShared Z3 context.
tcx: TyCtxt<'tcx>Compiler type context.
constructor_mir_mode: ConstructorMirModeConstructor MIR mode selected for this verification run.
path_state: VmState<'z3, 'tcx>Mutable state cloned when execution branches into separate paths.
Implementations§
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn resolve_origin(
&self,
value: &VmValue<'z3, 'tcx>,
) -> Option<VmOrigin>
pub(crate) fn resolve_origin( &self, value: &VmValue<'z3, 'tcx>, ) -> Option<VmOrigin>
Trace the origin of a pointer value through VM provenance.
Given a VmValue (extracted from a checkpoint argument), follows its provenance back to determine where the allocation came from.
Sourcefn classify_local(&self, local: &Local) -> VmOriginKind
fn classify_local(&self, local: &Local) -> VmOriginKind
Classify a local by its type.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn eval_contract_tree( &self, expr: &ContractExpr<'tcx>, checkpoint: Option<&Checkpoint<'tcx>>, ) -> Option<Int<'z3>>
pub(crate) fn instantiate_callsite_ty( &self, checkpoint: &Checkpoint<'tcx>, ty: Ty<'tcx>, ) -> Ty<'tcx>
fn instantiate_callsite_const( &self, checkpoint: &Checkpoint<'tcx>, index: u32, ) -> Option<Int<'z3>>
fn is_caller_type_param(&self, ty: Ty<'tcx>) -> bool
fn eval_contract_method_call( &self, receiver: &ContractExpr<'tcx>, method: DefId, args: &[ContractExpr<'tcx>], checkpoint: Option<&Checkpoint<'tcx>>, ) -> Option<Int<'z3>>
fn eval_contract_expr_check_leaf( &self, checkpoint: Option<&Checkpoint<'tcx>>, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>
pub(crate) fn eval_contract_expr_to_value( &self, checkpoint: Option<&Checkpoint<'tcx>>, expr: &ContractExpr<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>
fn eval_contract_place( &self, checkpoint: Option<&Checkpoint<'tcx>>, cp: &ContractPlace, ) -> Option<Int<'z3>>
fn eval_contract_operand(&self, op: &Operand<'tcx>) -> Option<Int<'z3>>
fn try_iter_len_from_fields( &self, checkpoint: &Checkpoint<'tcx>, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn callsite_contract_target_value(
&self,
args: &[Operand<'tcx>],
property: &Property<'tcx>,
) -> Option<VmValue<'z3, 'tcx>>
pub(crate) fn callsite_contract_target_value( &self, args: &[Operand<'tcx>], property: &Property<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>
Resolve a property’s target using the checkpoint’s call arguments.
fn callsite_contract_place_value( &self, args: &[Operand<'tcx>], place: &ContractPlace, ) -> Option<VmValue<'z3, 'tcx>>
pub(crate) fn has_bounded_object_span( &self, alloc_id: AllocId, value: &VmValue<'z3, 'tcx>, ty: Ty<'tcx>, ) -> bool
pub(crate) fn has_bounded_range( &self, alloc_id: AllocId, address: &Int<'z3>, bytes: &Int<'z3>, ) -> bool
pub(crate) fn callsite_operand_for_local<'a>( &self, checkpoint: &'a Checkpoint<'tcx>, local: usize, ) -> Option<&'a Operand<'tcx>>
Sourcepub(crate) fn contract_place_term_at(
&self,
checkpoint: &Checkpoint<'tcx>,
place: &ContractPlace,
) -> Option<Int<'z3>>
pub(crate) fn contract_place_term_at( &self, checkpoint: &Checkpoint<'tcx>, place: &ContractPlace, ) -> Option<Int<'z3>>
Bind a contract place to a term at this checkpoint. A callee parameter local refers to its callsite operand when one is available.
Sourcepub(crate) fn resolve_pointer_provenance(
&self,
value: VmValue<'z3, 'tcx>,
) -> VmValue<'z3, 'tcx>
pub(crate) fn resolve_pointer_provenance( &self, value: VmValue<'z3, 'tcx>, ) -> VmValue<'z3, 'tcx>
Penetrate a reference/raw-pointer target down to the owned heap behind
it. A target like &mut ManuallyDrop<Box<T>> or *mut Box<T> carries
the stack provenance of the referent; the properties that matter
(Allocated/Owning/ValidPtr) concern the heap object inside, so
resolve through the referent local’s owned heap field.
Sourcepub(crate) fn is_value_aligned(&self, value: &VmValue<'z3, 'tcx>) -> bool
pub(crate) fn is_value_aligned(&self, value: &VmValue<'z3, 'tcx>) -> bool
Whether value is known to be aligned: either align_n carries a
concrete alignment, or the value sits at the base of an allocation whose
align is not 1.
Sourcepub(crate) fn is_maybe_uninit_ptr(
&self,
value: &VmValue<'z3, 'tcx>,
alloc_id: AllocId,
) -> bool
pub(crate) fn is_maybe_uninit_ptr( &self, value: &VmValue<'z3, 'tcx>, alloc_id: AllocId, ) -> bool
Whether value is a MaybeUninit-typed pointer access into alloc_id.
assume_init_drop / as_mut_ptr (and friends) legitimately consume an
initialized element from storage that may be going out of scope, so the
Init/Allocated requirement concerns the write, not the allocation’s
live/dead flag.
Sourcepub(crate) fn unsized_slice_len(
&self,
value: &VmValue<'z3, 'tcx>,
required_ty: Option<Ty<'tcx>>,
) -> Option<Int<'z3>>
pub(crate) fn unsized_slice_len( &self, value: &VmValue<'z3, 'tcx>, required_ty: Option<Ty<'tcx>>, ) -> Option<Int<'z3>>
Element count of one object when the access is to an unsized [T]:
the slice length from the pointer’s metadata. An unknown length stays
unknown. Other objects return None.
Sourcepub(crate) fn access_bytes(
&self,
value: &VmValue<'z3, 'tcx>,
required_ty: Option<Ty<'tcx>>,
count: Int<'z3>,
) -> Int<'z3>
pub(crate) fn access_bytes( &self, value: &VmValue<'z3, 'tcx>, required_ty: Option<Ty<'tcx>>, count: Int<'z3>, ) -> Int<'z3>
Byte span requested by a pointer property, using the VM’s element-size model for concrete and generic pointee types.
Sourcepub(crate) fn atom_depends_on_inline_terms(
&self,
checkpoint: &Checkpoint<'tcx>,
property: &Property<'tcx>,
terms: &FxHashSet<Int<'z3>>,
) -> bool
pub(crate) fn atom_depends_on_inline_terms( &self, checkpoint: &Checkpoint<'tcx>, property: &Property<'tcx>, terms: &FxHashSet<Int<'z3>>, ) -> bool
Whether this atom’s target or a checkpoint argument depends on an unconstrained value introduced by incomplete inlining.
fn value_involves_terms( &self, terms: &FxHashSet<Int<'z3>>, value: &VmValue<'z3, 'tcx>, ) -> bool
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn inject_layout_constraints(
&mut self,
operand: &Operand<'tcx>,
val: &VmValue<'z3, 'tcx>,
)
pub(crate) fn inject_layout_constraints( &mut self, operand: &Operand<'tcx>, val: &VmValue<'z3, 'tcx>, )
Inject layout constraints (>= 1) for generic AlignOf/SizeOf constants.
Sourcepub(crate) fn try_emit_gcd_divisibility(
&mut self,
operand: &Operand<'tcx>,
val: &VmValue<'z3, 'tcx>,
)
pub(crate) fn try_emit_gcd_divisibility( &mut self, operand: &Operand<'tcx>, val: &VmValue<'z3, 'tcx>, )
Preserve the divisibility relation of the recursive gcd const expression used by slice::align_to_offsets. CTFE leaves its result symbolic for generic element sizes.
Sourcepub(crate) fn non_trivial_align(align: Int<'z3>) -> Option<Int<'z3>>
pub(crate) fn non_trivial_align(align: Int<'z3>) -> Option<Int<'z3>>
Some(align) when align is non-trivial (≠ 1); None for a byte
alignment, which carries no alignment guarantee.
Sourcepub(crate) fn alloc_align_of(
&self,
val: &VmValue<'z3, 'tcx>,
) -> Option<Int<'z3>>
pub(crate) fn alloc_align_of( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>
The provenance allocation’s alignment, when it is non-trivial (≠ 1).
Sourcepub(crate) fn emit_div_rem_axioms(
&mut self,
op: BinOp,
term: &Int<'z3>,
lhs: &Int<'z3>,
rhs: &Int<'z3>,
)
pub(crate) fn emit_div_rem_axioms( &mut self, op: BinOp, term: &Int<'z3>, lhs: &Int<'z3>, rhs: &Int<'z3>, )
Assert the Euclidean division identity and its bounds for Div/Rem:
lhs == (lhs/rhs)*rhs + lhs%rhs ∧ lhs%rhs >= 0
plus (lhs/rhs)*rhs <= lhs directly for robustness. This lets later
checks prove (x/N)*N <= x and x%N >= 0.
term must be the same Z3 term returned by eval_binary_op (the
quotient), not a separate lhs.div(rhs) call, so the axiom constrains
the term used in subsequent operations.
fn bool_as_int(&self, cond: &Bool<'z3>) -> Int<'z3>
fn negate(&self, val: &Int<'z3>) -> Int<'z3>
pub(crate) fn eval_binary_op( &mut self, op: BinOp, lhs: &Int<'z3>, rhs: &Int<'z3>, ) -> Int<'z3>
pub(crate) fn eval_unary_op( &mut self, op: UnOp, val: &Int<'z3>, is_bool: bool, ) -> Int<'z3>
pub(crate) fn integer_limits( &self, ty: Ty<'tcx>, ) -> Option<(Int<'z3>, Int<'z3>, Int<'z3>, bool)>
pub(crate) fn wrap_integer_term(&self, ty: Ty<'tcx>, raw: &Int<'z3>) -> Int<'z3>
Sourcefn compute_pointer_add_align(
&self,
base: &VmValue<'z3, 'tcx>,
stride_bytes: u64,
) -> Option<Int<'z3>>
fn compute_pointer_add_align( &self, base: &VmValue<'z3, 'tcx>, stride_bytes: u64, ) -> Option<Int<'z3>>
Compute the preserved alignment when doing base + offset * stride.
Pointer arithmetic only ever preserves the base’s alignment; it never
creates it. When the base’s alignment is unknown, we cannot conclude
anything about the result (a wrapping_add over misaligned storage does
not become aligned just because the stride is a power of two).
Sourcefn pointer_stride_term(
&mut self,
dest: Local,
base: &VmValue<'z3, 'tcx>,
stride: Option<u64>,
) -> Int<'z3>
fn pointer_stride_term( &mut self, dest: Local, base: &VmValue<'z3, 'tcx>, stride: Option<u64>, ) -> Int<'z3>
The byte stride for a pointer add/sub: the fixed stride, or the pointee’s
symbolic size when the stride is element-sized (a generic T).
Sourcepub(crate) fn apply_pointer_add(
&mut self,
dest: Local,
base: &VmValue<'z3, 'tcx>,
offset: &VmValue<'z3, 'tcx>,
stride: Option<u64>,
dereferenceable: bool,
)
pub(crate) fn apply_pointer_add( &mut self, dest: Local, base: &VmValue<'z3, 'tcx>, offset: &VmValue<'z3, 'tcx>, stride: Option<u64>, dereferenceable: bool, )
Model dest = base.offset(offset) with element/byte stride and tracked
provenance (offset_kind), shared by call effects
and the inlined Offset MIR statement.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn assert_call_result_invariants(&mut self, destination: Local)
pub(crate) fn assert_summary_result_type_invariants( &mut self, callee: DefId, destination: Local, )
pub(crate) fn assert_call_postconditions( &mut self, callee: DefId, args: &[Option<Local>], destination: Local, )
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn materialize_slice_ref_return(&mut self, dest: Local)
Sourcepub(crate) fn slice_len_of_alloc(&self, alloc_id: AllocId) -> Option<Int<'z3>>
pub(crate) fn slice_len_of_alloc(&self, alloc_id: AllocId) -> Option<Int<'z3>>
The slice/array element count for an allocation: the materialized
slice_len, or size / elem_size as a fallback for allocations created
before materialization (e.g. some call effects). Uses the symbolic
element size (size_sym_read) so len = (len·S) / S cancels to len
for a generic element type — mirroring set_len_from_alloc. Returns
None when the element type is unknown.
Sourcepub(crate) fn slice_len_from_value(
&self,
val: &VmValue<'z3, 'tcx>,
) -> Option<Int<'z3>>
pub(crate) fn slice_len_from_value( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>
The slice length of a &[T] / &mut [T] value, from pointer metadata
when available or its provenance allocation otherwise.
Sourcepub(crate) fn try_adt_len_field(
&self,
val: &VmValue<'z3, 'tcx>,
) -> Option<Int<'z3>>
pub(crate) fn try_adt_len_field( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>
Resolve x.len() for a pointer whose pointee ADT carries a len field
(e.g. NodeRef<LeafNode>: len() reads (*ptr).len). Returns the
pointee’s len field term, or None when the pointee has no such field.
Sourcefn try_adt_len_field_at(
&self,
alloc_id: AllocId,
ty: Ty<'tcx>,
root_ty: Ty<'tcx>,
prefix: &[usize],
) -> Option<Int<'z3>>
fn try_adt_len_field_at( &self, alloc_id: AllocId, ty: Ty<'tcx>, root_ty: Ty<'tcx>, prefix: &[usize], ) -> Option<Int<'z3>>
Resolve a len field on ty, recursing into ADT sub-fields when there is
no direct len (e.g. String { vec: Vec { ptr, len, cap } } resolves
String.len() to vec.len). root_ty stays fixed as the allocation’s
element type, which is how decompose_pointee_fields keys MemoryContent::values.
Sourcepub(crate) fn try_index_range_len(
&self,
val: &VmValue<'z3, 'tcx>,
) -> Option<Int<'z3>>
pub(crate) fn try_index_range_len( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>
Resolve len() for core::ops::IndexRange (a private { start, end }
struct): len() = end - start. The len field lookup above misses it
because IndexRange has no len field — its len() computes the
difference of its two private fields.
Sourcepub(crate) fn len_from_value(
&self,
val: &VmValue<'z3, 'tcx>,
) -> Option<Int<'z3>>
pub(crate) fn len_from_value( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>
Resolve len() of a slice/ADT value: the pointee ADT’s len field, then
the materialized slice length, then size / elem_size. Shared by the
exec- and checker-side Len evaluators so the fallback chain is defined
once.
pub(crate) fn capacity_from_value( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>
Sourcepub(crate) fn try_struct_nn_len_field(
&self,
local: Local,
field_path: &[usize],
ty: Ty<'tcx>,
) -> Option<Int<'z3>>
pub(crate) fn try_struct_nn_len_field( &self, local: Local, field_path: &[usize], ty: Ty<'tcx>, ) -> Option<Int<'z3>>
Resolve x.len() for a struct x (e.g. NodeRef) whose len() method
reads (*x.field).len through a NonNull/raw-pointer field. Follows
that field to its pointee allocation and reads the pointee’s len field.
Sourcepub(crate) fn field_type_at(
&self,
local: Local,
field_path: &[usize],
) -> Option<Ty<'tcx>>
pub(crate) fn field_type_at( &self, local: Local, field_path: &[usize], ) -> Option<Ty<'tcx>>
Resolve the type of a local plus its field-index path.
Sourcepub(crate) fn find_nn_pointee(&self, ty: Ty<'tcx>) -> Option<Ty<'tcx>>
pub(crate) fn find_nn_pointee(&self, ty: Ty<'tcx>) -> Option<Ty<'tcx>>
Extract the pointee type if ty is a #[repr(transparent)]
single-field raw-pointer wrapper (NonNull<P>) or wrapped in
Option<NonNull<P>>. Returns Some(P).
Detected structurally (via #[repr(transparent)] + a raw-pointer field)
rather than by name, so re-implemented std types in the challenge
suites are modelled identically to their std counterparts.
Sourcefn transparent_ptr_pointee(
&self,
adt_def: &AdtDef<'_>,
substs: GenericArgs<'tcx>,
) -> Option<Ty<'tcx>>
fn transparent_ptr_pointee( &self, adt_def: &AdtDef<'_>, substs: GenericArgs<'tcx>, ) -> Option<Ty<'tcx>>
Pointee type of a #[repr(transparent)] single-field raw-pointer
wrapper such as NonNull<T> (struct NonNull<T> { pointer: *const T }).
Sourcepub(crate) fn is_transparent_newtype(&self, ty: Ty<'tcx>) -> bool
pub(crate) fn is_transparent_newtype(&self, ty: Ty<'tcx>) -> bool
Whether ty is a #[repr(transparent)] newtype (a single non-zero-sized
field whose value is that field, e.g. MaybeUninit<T>, ManuallyDrop<T>,
Wrapping<T>, NonNull<T>). Construction and field reads are modelled
transparently: the wrapper value is the field value itself.
pub(crate) fn container_ptr_field(&self, ty: Ty<'tcx>) -> Option<Vec<usize>>
fn container_ptr_field_inner( &self, ty: Ty<'tcx>, prefix: Vec<usize>, depth: usize, ) -> Option<Vec<usize>>
pub(crate) fn container_data_alloc( &self, header: AllocId, ty: Ty<'tcx>, ) -> Option<AllocId>
Sourcepub(crate) fn data_alloc_of(
&self,
header: AllocId,
ty: Ty<'tcx>,
) -> Option<AllocId>
pub(crate) fn data_alloc_of( &self, header: AllocId, ty: Ty<'tcx>, ) -> Option<AllocId>
The data allocation behind a container header or a slice view’s header.
Tries the type-driven owning field first, then falls back to scanning the
header’s materialized fields for the first owning pointer (covers slice
views whose header AllocId no longer carries a type key).
Sourcefn header_data_alloc(&self, header: AllocId) -> Option<AllocId>
fn header_data_alloc(&self, header: AllocId) -> Option<AllocId>
Scan a header allocation’s materialized fields for the owning pointer
(its provenance names the data allocation). This is the header → data
fallback for slice views (whose provenance names the container header,
not the data), replacing the old slice_data edge.
Returns the provenance only when the header has exactly one owning
pointer field. A multi-owning-pointer header (e.g. a linked list’s
head/tail) is ambiguous, so fall back to None rather than guess.
Sourcepub(crate) fn vec_reallocation_targets(
&self,
value: &VmValue<'z3, 'tcx>,
) -> Vec<(AllocId, Ty<'tcx>)>
pub(crate) fn vec_reallocation_targets( &self, value: &VmValue<'z3, 'tcx>, ) -> Vec<(AllocId, Ty<'tcx>)>
Resolve a mutable Vec receiver, including a borrow of its backing buffer fields (as used by reserve’s MIR). A borrow of an unrelated field, such as the length, does not replace the backing allocation.
pub(crate) fn reallocate_vec_backing(&mut self, value: &VmValue<'z3, 'tcx>)
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn assert_contract_fact(&mut self, property: &Property<'tcx>)
fn collect_alias_hazard_allocs( &self, property: &Property<'tcx>, out: &mut FxHashSet<AllocId>, )
fn place_root_alloc(&self, cp: &ContractPlace) -> Option<AllocId>
Sourcefn assert_atom_direct(&mut self, property: &Property<'tcx>)
fn assert_atom_direct(&mut self, property: &Property<'tcx>)
Apply a single atom’s direct effect (its match kind arm), without
recursing into its subsumption consequences.
pub(crate) fn record_bounded_result_span(&mut self, destination: Local)
Sourcefn contract_target_local(&self, property: &Property<'tcx>) -> Option<Local>
fn contract_target_local(&self, property: &Property<'tcx>) -> Option<Local>
Get the local referenced by a contract property’s target.
fn assert_valid_cstr_fact(&mut self, property: &Property<'tcx>)
Sourcefn mark_alloc_live_keep(
&mut self,
val: &VmValue<'z3, 'tcx>,
elem_ty: Ty<'tcx>,
) -> bool
fn mark_alloc_live_keep( &mut self, val: &VmValue<'z3, 'tcx>, elem_ty: Ty<'tcx>, ) -> bool
Materialize a fresh external allocation for an Allocated contract
fact, returning a value carrying the allocation’s provenance.
Mark the target pointer’s existing allocation as live (and record its
element type for downstream Typed checks). Returns true when the
pointer already carried an allocation, so a fresh external allocation
should not be materialized (which would loosen bound checks).
fn materialize_external_alloc( &mut self, elem_ty: Ty<'tcx>, count_term: Option<Int<'z3>>, val_ty: Ty<'tcx>, huge: bool, ) -> VmValue<'z3, 'tcx>
Sourcefn assert_allocated_fact(&mut self, property: &Property<'tcx>)
fn assert_allocated_fact(&mut self, property: &Property<'tcx>)
Assert an Allocated(p, T, n) contract fact by materializing a fresh
external allocation for the pointer-typed target.
- For a whole pointer parameter (
src), the allocation is sizedn * sizeof(T)so downstream pointer arithmetic stays in bounds. - For a plain pointer field (e.g.
RawVecInner::ptr), the allocation is written back to the field viaset_contract_target_valueand retains an unknown extent with a separately recorded covered range. - For
Downcasttargets, the legacy whole-local behaviour applies.
fn materialize_allocated_fact(&mut self, property: &Property<'tcx>)
Sourcefn contract_field_path(
&self,
property: &Property<'tcx>,
) -> Option<(Local, Vec<usize>)>
fn contract_field_path( &self, property: &Property<'tcx>, ) -> Option<(Local, Vec<usize>)>
Resolve a contract place to (local, field_path). Field projections
are accumulated into field_path; Downcast/ForEach terminate
the path (they unwrap the value in place).
Sourcefn contract_target_value(
&self,
property: &Property<'tcx>,
) -> Option<VmValue<'z3, 'tcx>>
fn contract_target_value( &self, property: &Property<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>
Get the VmValue for a contract property’s target, following field
projections so that Align(self.heap, T) resolves to the heap field
value rather than the whole self reference.
Sourcefn set_contract_target_value(
&mut self,
property: &Property<'tcx>,
val: VmValue<'z3, 'tcx>,
)
fn set_contract_target_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )
Write a contract target value back to its (possibly field) location.
Sourcefn contract_alloc_id_field_aware(
&self,
property: &Property<'tcx>,
) -> Option<AllocId>
fn contract_alloc_id_field_aware( &self, property: &Property<'tcx>, ) -> Option<AllocId>
Resolve the alloc_id for a contract property target, following field projections to locate the actual field value’s provenance.
Sourcefn resolve_contract_count(&self, arg: &PropertyArg<'tcx>) -> Option<Int<'z3>>
fn resolve_contract_count(&self, arg: &PropertyArg<'tcx>) -> Option<Int<'z3>>
Resolve a contract count argument to a Z3 term by looking up the corresponding function parameter in the VM state.
Sourcefn eval_predicate_as_bool(
&self,
pred: &NumericPredicate<'tcx>,
) -> Option<Bool<'z3>>
fn eval_predicate_as_bool( &self, pred: &NumericPredicate<'tcx>, ) -> Option<Bool<'z3>>
Evaluate a numeric predicate to a Z3 Bool for path-condition assertion.
fn eval_numeric_binary( &self, left: &Int<'z3>, right: &Int<'z3>, op: BinOp, ) -> Option<Int<'z3>>
Sourcefn set_non_null_for_value(
&mut self,
property: &Property<'tcx>,
val: VmValue<'z3, 'tcx>,
)
fn set_non_null_for_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )
Set non_null invariant on the target value.
fn set_in_bounds_for_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )
fn assert_in_bound_for_each( &mut self, property: &Property<'tcx>, fe_base: &PlaceBase, )
Sourcefn assert_in_bound_single(&mut self, property: &Property<'tcx>)
fn assert_in_bound_single(&mut self, property: &Property<'tcx>)
Record the numeric index < len bound for a single-index
InBound(slice, index), so a derived index (e.g. index - 1 guarded by
index >= 1) can be discharged by SMT rather than only via the coarse
in_bounds flag. Range indices (start..end) are left to the checker’s
extract_range_end (end <= len).
fn record_index_access_fact(&mut self, property: &Property<'tcx>)
Sourcepub(crate) fn assert_pointee_struct_invariants(
&mut self,
dest_ty: Ty<'tcx>,
dest_local: Local,
)
pub(crate) fn assert_pointee_struct_invariants( &mut self, dest_ty: Ty<'tcx>, dest_local: Local, )
When a &T/&mut T reference is created (e.g. via &*NonNull<T>), assume
T’s #[rapx::invariant]s on the new reference local, rebinding the
invariant’s self place to that reference. This is what lets a struct’s
invariants flow through pointer dereferences into the caller’s state.
Sourcepub(crate) fn assert_alloc_pointee_invariants(
&mut self,
alloc_id: AllocId,
pointee_ty: Ty<'tcx>,
)
pub(crate) fn assert_alloc_pointee_invariants( &mut self, alloc_id: AllocId, pointee_ty: Ty<'tcx>, )
Assert a pointee ADT’s #[rapx::invariant] struct invariants directly
against its materialized per-allocation field values. This is the
pointer-field analogue of [assert_pointee_struct_invariants](Self::
assert_pointee_struct_invariants): that helper covers &T references,
while this one covers NonNull<T> / Box<T> pointer fields whose
pointee is decomposed by init_ptr_field (e.g. NodeRef.node: NonNull<LeafNode> must satisfy LeafNode’s len <= CAPACITY).
Sourcefn eval_pointee_predicate_as_bool(
&self,
alloc_id: AllocId,
view_ty: Ty<'tcx>,
pred: &NumericPredicate<'tcx>,
) -> Option<Bool<'z3>>
fn eval_pointee_predicate_as_bool( &self, alloc_id: AllocId, view_ty: Ty<'tcx>, pred: &NumericPredicate<'tcx>, ) -> Option<Bool<'z3>>
Evaluate a ValidNum predicate against a pointee allocation (not a MIR
local): field places resolve through MemoryContent::values keyed by the
pointee type.
Sourcefn eval_pointee_expr(
&self,
alloc_id: AllocId,
view_ty: Ty<'tcx>,
expr: &ContractExpr<'tcx>,
) -> Option<Int<'z3>>
fn eval_pointee_expr( &self, alloc_id: AllocId, view_ty: Ty<'tcx>, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>
Evaluate a numeric ContractExpr against a pointee allocation.
Sourcefn eval_pointee_expr_value(
&self,
alloc_id: AllocId,
view_ty: Ty<'tcx>,
expr: &ContractExpr<'tcx>,
) -> Option<VmValue<'z3, 'tcx>>
fn eval_pointee_expr_value( &self, alloc_id: AllocId, view_ty: Ty<'tcx>, expr: &ContractExpr<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>
Resolve a Place (or Len inner) against a pointee allocation, returning
the materialized VmValue so slice-length fallbacks can read provenance.
Sourcefn set_align_for_value(
&mut self,
property: &Property<'tcx>,
val: VmValue<'z3, 'tcx>,
)
fn set_align_for_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )
Set align invariant on the target value.
Sourcefn set_init_for_value(
&mut self,
property: &Property<'tcx>,
val: VmValue<'z3, 'tcx>,
)
fn set_init_for_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )
Set init invariant on the target value and its allocation.
Sourcefn set_owning_for_value(&mut self, val: VmValue<'z3, 'tcx>)
fn set_owning_for_value(&mut self, val: VmValue<'z3, 'tcx>)
Set owning invariant on the target value.
fn for_each_target_alloc(&self, property: &Property<'tcx>) -> Option<AllocId>
Sourcefn record_for_each_align(&mut self, property: &Property<'tcx>)
fn record_for_each_align(&mut self, property: &Property<'tcx>)
Record the Align(container.iter(), T) for_each fact: every element
pointer is aligned to align_of(T). Anchored to the container
allocation so a pointer loaded from it can discharge Align(cur, T).
Sourcefn record_for_each_allocated(&mut self, property: &Property<'tcx>)
fn record_for_each_allocated(&mut self, property: &Property<'tcx>)
Record the Allocated(container.iter(), T, n) for_each fact: every
element pointer backs >= n T elements (n may be symbolic).
Sourcefn record_for_each_owning(&mut self, property: &Property<'tcx>)
fn record_for_each_owning(&mut self, property: &Property<'tcx>)
Record the Owning(container.iter()) for_each fact: every element
pointer is the sole owner of its pointee. Anchored to the container
allocation so a pointer loaded from it can discharge Owning(cur).
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn bound_contract_place_value(
&self,
place: &ContractPlace,
) -> Option<VmValue<'z3, 'tcx>>
pub(crate) fn bound_contract_place_value( &self, place: &ContractPlace, ) -> Option<VmValue<'z3, 'tcx>>
Resolve a contract place already bound to this frame’s locals.
fn eval_contract_fact_tree(&self, expr: &ContractExpr<'tcx>) -> Option<Int<'z3>>
pub(crate) fn eval_contract_expr_simple( &self, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>
fn eval_contract_expr_simple_leaf( &self, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>
fn eval_contract_expr_simple_value( &self, expr: &ContractExpr<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>
fn try_simple_iter_len(&self, arg_val: &VmValue<'z3, 'tcx>) -> Option<Int<'z3>>
pub(crate) fn is_local_adt_receiver(&self, value: &VmValue<'z3, 'tcx>) -> bool
pub(crate) fn contract_binary_term( &self, op: BinOp, left: &Int<'z3>, right: &Int<'z3>, ) -> Option<Int<'z3>>
pub(crate) fn contract_unary_term( &self, op: UnaryOp, value: &Int<'z3>, ) -> Int<'z3>
pub(crate) fn contract_relop_bool( &self, op: RelOp, left: &Int<'z3>, right: &Int<'z3>, ) -> Bool<'z3>
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn execute_items(self, items: &[RelevantItem<'tcx>]) -> Vec<Self>
pub(crate) fn execute_items(self, items: &[RelevantItem<'tcx>]) -> Vec<Self>
Execute all retained MIR items in path order.
pub(crate) fn execute_items_after( states: Vec<Self>, items: &[RelevantItem<'tcx>], ) -> Vec<Self>
Sourcepub(crate) fn execute_items_after_with_cleanup(
states: Vec<Self>,
items: &[RelevantItem<'tcx>],
) -> Vec<Self>
pub(crate) fn execute_items_after_with_cleanup( states: Vec<Self>, items: &[RelevantItem<'tcx>], ) -> Vec<Self>
Replay items while retaining a selected cleanup successor after a call.
fn execute_items_after_inner( states: Vec<Self>, items: &[RelevantItem<'tcx>], retain_cleanup: bool, ) -> Vec<Self>
fn execute_item( &mut self, item: &RelevantItem<'tcx>, retain_cleanup: bool, ) -> bool
Sourcefn handle_callee_entry(
&mut self,
callee: DefId,
body: Option<&'tcx Body<'tcx>>,
args: &[CallArg],
)
fn handle_callee_entry( &mut self, callee: DefId, body: Option<&'tcx Body<'tcx>>, args: &[CallArg], )
Enter an inlined callee during path execution: save the caller context, switch to the callee body, and bind the caller’s argument locals to the callee’s parameters.
Sourcefn handle_callee_exit(&mut self, dest: usize)
fn handle_callee_exit(&mut self, dest: usize)
Exit an inlined callee: capture the callee’s return value, restore the caller context, and write the return value to the caller’s destination.
A ManuallyDrop<Owner> retained at return keeps its strong share alive.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn eval_contract_method( &self, method: DefId, receiver: VmValue<'z3, 'tcx>, receiver_local: Option<Local>, args: Vec<Int<'z3>>, ) -> Option<Int<'z3>>
fn eval_contract_method_paths( &self, method: DefId, values: &[VmValue<'z3, 'tcx>], receiver_local: Option<Local>, ) -> Option<Int<'z3>>
Sourcepub(super) fn exec_inline_call(
&mut self,
callee_def_id: DefId,
instance: Option<Instance<'tcx>>,
call_args: &[Spanned<Operand<'tcx>>],
arg_values: &[VmValue<'z3, 'tcx>],
caller_arg_locals: &[Option<Local>],
dest: Local,
) -> bool
pub(super) fn exec_inline_call( &mut self, callee_def_id: DefId, instance: Option<Instance<'tcx>>, call_args: &[Spanned<Operand<'tcx>>], arg_values: &[VmValue<'z3, 'tcx>], caller_arg_locals: &[Option<Local>], dest: Local, ) -> bool
Recursively execute a callee’s MIR body inline.
Binds the caller’s argument values to the callee’s parameters, executes the callee’s MIR, and writes the return value to the caller’s destination local. Returns whether the call may return.
fn forget_inline_referent(&mut self, local: Local)
fn inline_execute_body(&mut self, pre_uninit: &[AllocId]) -> Option<Vec<Self>>
fn inline_execute_single(&mut self) -> InlineStep<'z3, 'tcx>
fn inline_execute_branches( &mut self, pre_uninit: &[AllocId], pending: Vec<(VmExecutor<'z3, 'tcx>, BasicBlock, FxHashSet<BasicBlock>)>, ) -> Option<Vec<Self>>
fn find_uninit_witness( &self, switch: &Terminator<'tcx>, candidates: &[AllocId], ) -> FxHashSet<AllocId>
fn allocation_needs_write(&self, id: AllocId) -> bool
pub(crate) fn replay_deferred_writes( &mut self, writes: Vec<(Local, Vec<usize>, VmValue<'z3, 'tcx>)>, )
Sourcepub(crate) fn find_whole_borrow_referent(&self, local: Local) -> Option<Local>
pub(crate) fn find_whole_borrow_referent(&self, local: Local) -> Option<Local>
Resolve a direct mutable borrow or a whole-place reborrow back to its
referent local. Used to
propagate the referent’s materialized field values into an inlined
callee when the reborrow temp’s own forward assignment was pruned from
the slice (so its value is still the stack-address default and
find_local_by_address can only self-match). Deliberately excludes
field reborrows (&mut (*_x).field) — those address a subfield, whose
value is tracked separately, so propagating the whole struct’s fields
would be wrong (BTreeMap’s NodeRef handles).
Sourcepub(crate) fn find_field_reborrow_referent(
&self,
local: Local,
) -> Option<(Local, Vec<usize>)>
pub(crate) fn find_field_reborrow_referent( &self, local: Local, ) -> Option<(Local, Vec<usize>)>
Resolve a field reborrow (_7 = &mut (*_x).field, projection
[Deref, Field(..)*]) back to its referent local plus the field path.
Sourcepub(crate) fn find_copy_root(&self, local: Local) -> Option<Local>
pub(crate) fn find_copy_root(&self, local: Local) -> Option<Local>
Resolve a whole-place copy root: _x = copy _y / _x = move _y (no
projection) traces _x back to _y. Used to recover a value parameter’s
materialized fields when the optimizer inserted a copy temporary between
the caller’s argument and the inlined callee’s parameter (e.g.
get_ext’s _2 = copy _1 before NonZero::get(move _2)), so that
handle_callee_entry’s field collection can follow the copy chain to the
local that actually carries the fields.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn diagnostics(&self) -> &Diagnostics
pub(crate) fn recover_copy_memory_target(&mut self, before: &Diagnostics)
pub(crate) fn recover_missing_mir(&mut self, before: &Diagnostics)
pub(crate) fn current_def_id(&self) -> DefId
pub(crate) fn local_alloc_id(&self, local: Local) -> Option<AllocId>
pub(crate) fn local_allocations( &self, ) -> impl Iterator<Item = (Local, AllocId)> + '_
pub(crate) fn cached_size(&self, ty: Ty<'tcx>) -> Option<&Int<'z3>>
pub(crate) fn incomplete_inline_terms( &self, ) -> impl Iterator<Item = &FxHashSet<Int<'z3>>>
pub(crate) fn opaque_intrinsic_terms(&self) -> &FxHashSet<Int<'z3>>
pub(crate) fn has_matching_index_access_fact( &self, slice_val: &VmValue<'z3, 'tcx>, index_val: &VmValue<'z3, 'tcx>, ) -> bool
pub(crate) fn enable_memory_events(&mut self)
pub(crate) fn memory_events(&self) -> Option<Ref<'_, Vec<MemoryEvent>>>
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn iter_ptr_end(
&self,
local: Local,
) -> Option<(VmValue<'z3, 'tcx>, VmValue<'z3, 'tcx>)>
pub(crate) fn iter_ptr_end( &self, local: Local, ) -> Option<(VmValue<'z3, 'tcx>, VmValue<'z3, 'tcx>)>
The two pointer fields of an Iter/IterMut local ([0] = ptr, [1] =
end_or_len), which share the same allocation. Returns None when
either field is missing or the two point into different allocations.
Sourcepub(crate) fn iter_elem_size(&self, ptr: &VmValue<'z3, 'tcx>) -> Int<'z3>
pub(crate) fn iter_elem_size(&self, ptr: &VmValue<'z3, 'tcx>) -> Int<'z3>
Element size of the type iterated by an Iter/IterMut pointer, symbolic
(sizeof_T) for a generic element type so size / elem_size cancels.
Sourcepub(crate) fn iter_len_from_ptrs(
&self,
ptr: &VmValue<'z3, 'tcx>,
end: &VmValue<'z3, 'tcx>,
) -> Option<Int<'z3>>
pub(crate) fn iter_len_from_ptrs( &self, ptr: &VmValue<'z3, 'tcx>, end: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>
Element count from two pointer fields sharing the same allocation:
(end.offset - ptr.offset) / elem_size. When both pointers carry an
element-structured offset (OffsetKind::Element, or the base), the
count is computed element-wise (end_elem - ptr_elem) so the
(end·S - ptr·S)/S division is avoided for a generic element size S.
Sourcepub(crate) fn iter_ptr_comparison(
&mut self,
op: BinOp,
lhs: &VmValue<'z3, 'tcx>,
rhs: &VmValue<'z3, 'tcx>,
) -> Option<Bool<'z3>>
pub(crate) fn iter_ptr_comparison( &mut self, op: BinOp, lhs: &VmValue<'z3, 'tcx>, rhs: &VmValue<'z3, 'tcx>, ) -> Option<Bool<'z3>>
Compare pointers by their MIR-derived element indices when they use the same positive byte stride. The tracked std iterator offset remains a fallback when an element index is unavailable.
Sourcepub(crate) fn track_iter_ptr_update(&mut self, local: Local)
pub(crate) fn track_iter_ptr_update(&mut self, local: Local)
If local is a reference to Iter/IterMut and field 0 (ptr)
is updated, increment the cumulative ptr offset so that
interpreter_iter_len can express len = initial_len - offset
instead of nested (end - (ptr + sz + sz + ...)) / sz.
Sourcefn iter_buffer(&self, local: Local) -> Option<AllocId>
fn iter_buffer(&self, local: Local) -> Option<AllocId>
The buffer an Iter/IterMut at local walks: the provenance of its
end field. This is frame-independent (the buffer allocation is
path-scoped), unlike the local itself. The iterator’s own allocation
keys its element index in iter_ptr_offset.
Sourcepub(crate) fn iter_utf8_buffer(
&self,
local: Local,
) -> Option<(AllocId, Int<'z3>)>
pub(crate) fn iter_utf8_buffer( &self, local: Local, ) -> Option<(AllocId, Int<'z3>)>
The byte buffer walked by an iterator at local, possibly wrapped in
adapter types (Cloned/Rev/…). Rvalue::Aggregate flattens nested
adapters, so the innermost Iter/IterMut end pointer is any tracked
field whose path ends in [1]. Return its allocation and end offset
(the end offset doubles as the byte length when the element is u8).
pub(crate) fn is_iter_ref(&self, val: &VmValue<'z3, 'tcx>) -> bool
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn prewarm_generic_size_align(&mut self)
pub(crate) fn prewarm_generic_size_align(&mut self)
Pre-warm a shared symbolic sizeof_T / align_T for every generic type
parameter of the caller, so the read-only *_sym_read fallback is dead.
Sourcepub(crate) fn materialize_external_field(
&mut self,
local: Local,
idx: usize,
field_ty: Ty<'tcx>,
elem_ty: Ty<'tcx>,
alive_region: Option<Region<'tcx>>,
)
pub(crate) fn materialize_external_field( &mut self, local: Local, idx: usize, field_ty: Ty<'tcx>, elem_ty: Ty<'tcx>, alive_region: Option<Region<'tcx>>, )
Materialize a struct field holding a reference (&T / &[T]), a DST
slice ([T]), or a heap-backed smart pointer (Box/Vec) as an external
allocation, so field access (e.g. self.buckets.iter(), as_ptr())
resolves to the data rather than the whole struct. The caller
pre-computes elem_ty (the pointee / slice element). alive_region
carries the lifetime of a reference field (&'a T), marking its
referent alive for 'a (a reference guarantees its referent is alive);
a raw slice / Box / Vec field carries no such guarantee and passes
None.
Sourcefn materialize_external_field_at(
&mut self,
local: Local,
path: Vec<usize>,
field_ty: Ty<'tcx>,
elem_ty: Ty<'tcx>,
alive_region: Option<Region<'tcx>>,
)
fn materialize_external_field_at( &mut self, local: Local, path: Vec<usize>, field_ty: Ty<'tcx>, elem_ty: Ty<'tcx>, alive_region: Option<Region<'tcx>>, )
Materialize an external allocation and bind it as the value at path,
carrying data provenance and an optional liveness region. Slice fields
receive symbolic length metadata; other fields retain an unknown extent.
Shared by
the whole-field (materialize_external_field) and pointer-subfield
(materialize_vec_ptr_field) materialization paths.
Sourcepub(crate) fn init_ptr_field(
&mut self,
local: Local,
path: Vec<usize>,
field_ty: Ty<'tcx>,
pointee: Ty<'tcx>,
local_idx: usize,
idx: usize,
elem_alloc: &mut FxHashMap<Ty<'tcx>, (AllocId, Int<'z3>)>,
is_raw_ptr: bool,
nn_fresh_prefix: &str,
)
pub(crate) fn init_ptr_field( &mut self, local: Local, path: Vec<usize>, field_ty: Ty<'tcx>, pointee: Ty<'tcx>, local_idx: usize, idx: usize, elem_alloc: &mut FxHashMap<Ty<'tcx>, (AllocId, Int<'z3>)>, is_raw_ptr: bool, nn_fresh_prefix: &str, )
Initialize one pointer-like field (raw pointer or NonNull<T>) of a
decomposed struct/ref parameter. The first field with a given pointee
type creates a shared external allocation; later fields with the same
pointee reuse it with a symbolic offset, preserving relationships like
ptr = start, end_or_len = start + len.
fn unsized_tail_layout(&self, ty: Ty<'tcx>) -> Option<(Ty<'tcx>, u64)>
Sourcepub(crate) fn decompose_adt_fields(
&mut self,
local: Local,
prefix: Vec<usize>,
ty: Ty<'tcx>,
local_idx: usize,
elem_alloc: &mut FxHashMap<Ty<'tcx>, (AllocId, Int<'z3>)>,
depth: usize,
)
pub(crate) fn decompose_adt_fields( &mut self, local: Local, prefix: Vec<usize>, ty: Ty<'tcx>, local_idx: usize, elem_alloc: &mut FxHashMap<Ty<'tcx>, (AllocId, Int<'z3>)>, depth: usize, )
Recursively decompose a (possibly nested) struct parameter into per-field
symbolic values. Nested ADT fields (e.g. Handle { node: NodeRef { node: NonNull<LeafNode>, .. }, .. }) are descended into so their NonNull /
raw-pointer leaves get external-allocation provenance — otherwise a
NonNull buried two levels deep loses its provenance and downstream
Allocated/Init checks (e.g. descend’s edges.get_unchecked) fail.
Sourcepub(crate) fn materialize_vec_ptr_field(
&mut self,
local: Local,
prefix: Vec<usize>,
field_ty: Ty<'tcx>,
) -> bool
pub(crate) fn materialize_vec_ptr_field( &mut self, local: Local, prefix: Vec<usize>, field_ty: Ty<'tcx>, ) -> bool
Materialize only the owning pointer field of a non-generic Vec-like ADT
field (e.g. struct Vec { ptr: NonNull<u8>, len, cap }), so an inlined
Vec::as_ptr’s _2 = copy (*self).ptr resolves to the data provenance.
The scalar len/cap fields are deliberately left unmaterialized — their
ValidNum invariants are established separately by the struct-invariant
assertion, not by fresh unconstrained symbols (which would fail ValidNum).
The caller has already ensured field_ty is a non-enum Vec.
Sourcefn field_term_from_bytes(
&self,
alloc_id: AllocId,
offset: usize,
size: usize,
) -> Option<Int<'z3>>
fn field_term_from_bytes( &self, alloc_id: AllocId, offset: usize, size: usize, ) -> Option<Int<'z3>>
Read a scalar field’s value back out of the byte layer over
[offset, offset + size) (little-endian). Returns None when the byte
layer does not cover the whole field (a hole, or no byte written), so
the caller falls back to a fresh symbol.
This is the byte→field direction of the cast cross-view materialization:
when bytes are written first (*buf = 3) and the buffer is then
reinterpreted as a repr(C) struct, the field value is those bytes, not
an unrelated fresh symbol.
Sourcepub(crate) fn decompose_pointee_fields(
&mut self,
alloc_id: AllocId,
prefix: Vec<usize>,
ty: Ty<'tcx>,
root_ty: Ty<'tcx>,
local_idx: usize,
depth: usize,
byte_offset: usize,
)
pub(crate) fn decompose_pointee_fields( &mut self, alloc_id: AllocId, prefix: Vec<usize>, ty: Ty<'tcx>, root_ty: Ty<'tcx>, local_idx: usize, depth: usize, byte_offset: usize, )
Recursively decompose a pointee ADT’s fields into per-allocation field
tracking, mirroring decompose_adt_fields
but keyed by allocation instead of local. This is what lets a
&*NonNull<LeafNode> dereference resolve (*leaf).len to the actual
len field value rather than the raw pointer term.
byte_offset is the running byte offset of the field being decomposed,
used for the byte→field cross-view materialization (see
Self::field_term_from_bytes).
Sourcepub(crate) fn try_materialize_const_bytes(
&mut self,
val: &mut VmValue<'z3, 'tcx>,
operand: &Operand<'tcx>,
)
pub(crate) fn try_materialize_const_bytes( &mut self, val: &mut VmValue<'z3, 'tcx>, operand: &Operand<'tcx>, )
If operand is a constant reference to a byte array (e.g. b"hello\0"),
extract the raw bytes and create a tracked allocation. Updates val
in-place with the proper provenance and invariants.
pub(crate) fn trace_to_const_bytes( &self, operand: &Operand<'tcx>, ) -> Option<Vec<u8>>
Sourcepub(crate) fn propagate_field_values_to_ref(
&mut self,
source_place: &Place<'tcx>,
dest: Local,
)
pub(crate) fn propagate_field_values_to_ref( &mut self, source_place: &Place<'tcx>, dest: Local, )
Propagate a source place’s per-field values to a reference destination,
shifting the field path by the source place’s Field projection prefix.
E.g. for _3 = &(_1.0) where _1 is a Handle { node: NodeRef { node: NonNull<..>, .. }, .. }, the nested NonNull’s field value stored at
path [0, 1] becomes available at _3’s path [1], so an inlined
callee that dereferences _3 and reads its node field sees the
provenance of the underlying allocation.
pub(crate) fn propagate_byte_values_to_ref( &mut self, source_place: &Place<'tcx>, ref_val: &VmValue<'z3, 'tcx>, )
Sourcepub(crate) fn aggregate_field_tys(&self, ty: Ty<'tcx>) -> Vec<Ty<'tcx>>
pub(crate) fn aggregate_field_tys(&self, ty: Ty<'tcx>) -> Vec<Ty<'tcx>>
Return the per-field types for an aggregate’s operands.
Sourcepub(crate) fn materialize_vec_fields(
&mut self,
local: Local,
ptr: VmValue<'z3, 'tcx>,
cap: Int<'z3>,
len: Int<'z3>,
)
pub(crate) fn materialize_vec_fields( &mut self, local: Local, ptr: VmValue<'z3, 'tcx>, cap: Int<'z3>, len: Int<'z3>, )
Materialize the {ptr, cap, len} field values of a Vec<T> aggregate
at local. The backing-buffer pointer is written to the owning raw
pointer field (located generically via Self::container_ptr_field);
the len/cap are no longer materialized as fields — they are asserted
as path conditions and tracked by the backing allocation’s slice length.
The symbolic invariant 0 <= len <= cap and cap * elem_size <= isize::MAX is asserted as a path condition so downstream len() /
capacity() / InBound / ValidNum queries agree.
Sourcepub(crate) fn materialize_vec_len_cap(
&mut self,
cap: Int<'z3>,
len: Int<'z3>,
elem_size: u64,
)
pub(crate) fn materialize_vec_len_cap( &mut self, cap: Int<'z3>, len: Int<'z3>, elem_size: u64, )
Assert the Vec length/capacity invariants 0 <= len <= cap and
cap * elem_size <= isize::MAX as path conditions.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn bounded_span(
&self,
value: &VmValue<'z3, 'tcx>,
ty: Ty<'tcx>,
) -> Option<(Int<'z3>, Ty<'tcx>, Option<Int<'z3>>)>
pub(crate) fn bounded_span( &self, value: &VmValue<'z3, 'tcx>, ty: Ty<'tcx>, ) -> Option<(Int<'z3>, Ty<'tcx>, Option<Int<'z3>>)>
The key of a bounded span. Unsized slices and strings also need their length.
pub(crate) fn copy_memory_values( &mut self, source: &VmValue<'z3, 'tcx>, target: &VmValue<'z3, 'tcx>, count: &VmValue<'z3, 'tcx>, )
pub(crate) fn forget_memory_values(&mut self, alloc_id: AllocId)
pub(crate) fn swap_memory_values( &mut self, left: &VmValue<'z3, 'tcx>, right: &VmValue<'z3, 'tcx>, ) -> bool
pub(crate) fn clear_write_evidence(&mut self, alloc_id: AllocId)
pub(crate) fn write_provenance_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, value: VmValue<'z3, 'tcx>, ) -> bool
Sourcefn write_reinterpreted_integer_allocation(
&mut self,
pointer: &VmValue<'z3, 'tcx>,
value: VmValue<'z3, 'tcx>,
) -> bool
fn write_reinterpreted_integer_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, value: VmValue<'z3, 'tcx>, ) -> bool
A typed whole-object write through a cast pointer replaces the start of an integer buffer while keeping its original allocation element type.
pub(crate) fn invalidate_provenance_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, )
fn write_field_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, value: VmValue<'z3, 'tcx>, ) -> bool
pub(crate) fn read_field_allocation( &self, pointer: &VmValue<'z3, 'tcx>, pointee_ty: Ty<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>
fn field_path_at_offset( &self, ty: Ty<'tcx>, offset: u64, target_ty: Ty<'tcx>, ) -> Option<Vec<usize>>
fn write_indexed_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, value: VmValue<'z3, 'tcx>, ) -> bool
pub(crate) fn address_of_place( &mut self, place: &Place<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>
Sourcepub(crate) fn ensure_local_allocation(&mut self, local: Local)
pub(crate) fn ensure_local_allocation(&mut self, local: Local)
Lazily create a stack allocation for a MIR local if one doesn’t exist.
pub(crate) fn field_offset_in_bytes( &self, ty: Ty<'tcx>, field_idx: usize, ) -> u64
pub(crate) fn size_of_ty(&self, ty: Ty<'tcx>) -> u64
pub(crate) fn align_of_ty(&self, ty: Ty<'tcx>) -> u64
pub(crate) fn allocation_size(&self, alloc_id: AllocId) -> &Int<'z3>
pub(crate) fn allocation_base(&self, alloc_id: AllocId) -> &Int<'z3>
Sourcepub(crate) fn pointee_elem_size(&self, ty: Ty<'tcx>) -> u64
pub(crate) fn pointee_elem_size(&self, ty: Ty<'tcx>) -> u64
Get the element size (in bytes) for a pointer type, peeling
through *const T, *mut T, &T, and &[T] to find size_of(T).
Sourcepub(crate) fn size_sym(&mut self, ty: Ty<'tcx>) -> Int<'z3>
pub(crate) fn size_sym(&mut self, ty: Ty<'tcx>) -> Int<'z3>
Element size of ty as a symbolic Z3 term. For concrete types this is
the constant byte size; for a generic type whose size_of is unknown
(an unconstrained T) it is a single reusable symbolic constant with
>= 0 (so T may be a ZST). Using the same constant everywhere (ptr
strides, access counts, allocation sizes) lets SMT cancel the factor in
InBound.
Sourcepub(crate) fn const_len_term(&self, const_len: &Const<'tcx>) -> Int<'z3>
pub(crate) fn const_len_term(&self, const_len: &Const<'tcx>) -> Int<'z3>
The array length N as a Z3 term (concrete value or symbolic const
generic). The symbolic name mirrors value_of_operand’s formatting so it
is identical to the const N term appearing in path conditions.
Sourcepub(crate) fn size_sym_read(&self, ty: Ty<'tcx>) -> Int<'z3>
pub(crate) fn size_sym_read(&self, ty: Ty<'tcx>) -> Int<'z3>
Read-only sibling of size_sym: returns the symbolic
size for ty, falling back to 1 when the symbolic constant has not
been created yet (e.g. a checker invoked before the exec phase created
it). Non-ZST concrete types return their constant byte size; a concrete
ZST or a not-yet-created generic constant falls back to 1 — a non-zero
element size keeps size / elem_size derivations from dividing by zero.
Sourcepub(crate) fn generic_elem_size(&self, alloc_id: AllocId) -> Option<Int<'z3>>
pub(crate) fn generic_elem_size(&self, alloc_id: AllocId) -> Option<Int<'z3>>
The symbolic element-size term of alloc_id’s element type, when it is
a generic type parameter (so it may be 0 for a ZST or ≥ 1 for a
non-ZST). Returns None for concrete element types, where the size is a
known constant and no case split is needed.
Sourcepub(crate) fn align_sym(&mut self, ty: Ty<'tcx>) -> Int<'z3>
pub(crate) fn align_sym(&mut self, ty: Ty<'tcx>) -> Int<'z3>
Alignment of ty as a symbolic Z3 term. For a concrete type this is
the constant byte alignment; for a generic type it is a reusable
symbolic constant align_T with >= 1, lower-bounded by the trait
bounds’ minimum alignment, and linked to the element size by the layout
constraint sizeof_T % align_T == 0 (a type’s size is always a multiple
of its alignment). For a generic struct, its alignment is additionally
constrained to be a multiple of each field’s alignment, so a field
pointer ((*node).value) inherits the container’s alignment.
Sourcepub(crate) fn align_sym_read(&self, ty: Ty<'tcx>) -> Int<'z3>
pub(crate) fn align_sym_read(&self, ty: Ty<'tcx>) -> Int<'z3>
Read-only sibling of align_sym: returns the
symbolic alignment for ty, falling back to the trait bounds’ minimum
alignment when the constant has not been created yet (e.g. a generic U
that only appears in a cast/contract, never as an allocation element
type). Concrete types return their constant alignment.
Sourcepub(crate) fn struct_size_sym(&mut self, ty: Ty<'tcx>) -> Option<Int<'z3>>
pub(crate) fn struct_size_sym(&mut self, ty: Ty<'tcx>) -> Option<Int<'z3>>
Size of a struct/ADT as the sum of its fields’ sizes (each via
size_sym). This lower-bounds the real layout so a
field reference (Allocated(&alloc)) can be discharged against the
struct allocation (sizeof_A <= 8 + 8 + sizeof_A). Returns None for
non-ADT or enum types.
Sourcefn uninit_byte(&self) -> Int<'z3>
fn uninit_byte(&self) -> Int<'z3>
The shared UNINIT sentinel (≥ 256, outside the u8 range).
Sourcefn fresh_byte_array(&self) -> Array<'z3>
fn fresh_byte_array(&self) -> Array<'z3>
A fresh Array<Int, Int> whose every offset reads UNINIT.
Sourcepub(crate) fn byte_read(&self, alloc_id: AllocId, i: &Int<'z3>) -> Int<'z3>
pub(crate) fn byte_read(&self, alloc_id: AllocId, i: &Int<'z3>) -> Int<'z3>
Read byte[i] at a (possibly symbolic) offset; unwritten offsets read UNINIT.
The result is simplified so a select(store(…), i) chain (built up by
repeated byte_write / copy_byte_tracking) collapses to its constant
byte value when i is concrete, rather than leaking the nested
select/store expression into downstream SMT obligations.
pub(crate) fn fill_byte_array( &mut self, pointer: &VmValue<'z3, 'tcx>, byte: u64, ) -> bool
Sourcepub(crate) fn byte_write(
&mut self,
alloc_id: AllocId,
i: &Int<'z3>,
v: &Int<'z3>,
)
pub(crate) fn byte_write( &mut self, alloc_id: AllocId, i: &Int<'z3>, v: &Int<'z3>, )
Write byte[i] = v.
Sourcepub(crate) fn record_byte_value(
&mut self,
alloc_id: AllocId,
offset: usize,
term: Int<'z3>,
)
pub(crate) fn record_byte_value( &mut self, alloc_id: AllocId, offset: usize, term: Int<'z3>, )
Record a per-byte symbolic value at a concrete offset in an allocation.
Sourcepub(crate) fn mark_byte_init(&mut self, alloc_id: AllocId, offset: usize)
pub(crate) fn mark_byte_init(&mut self, alloc_id: AllocId, offset: usize)
Mark a byte as initialized (written) with an unknown value.
Sourcepub(crate) fn is_byte_init(&self, alloc_id: AllocId, offset: usize) -> bool
pub(crate) fn is_byte_init(&self, alloc_id: AllocId, offset: usize) -> bool
Whether a byte at a concrete offset was written (select != UNINIT).
Sourcepub(crate) fn is_byte_nul(&self, alloc_id: AllocId, offset: usize) -> bool
pub(crate) fn is_byte_nul(&self, alloc_id: AllocId, offset: usize) -> bool
Whether a byte at a concrete offset is known NUL.
Sourcepub(crate) fn is_byte_non_nul(&self, alloc_id: AllocId, offset: usize) -> bool
pub(crate) fn is_byte_non_nul(&self, alloc_id: AllocId, offset: usize) -> bool
Whether a byte at a concrete offset is known non-NUL.
Sourcepub(crate) fn alloc_byte_values(
&self,
alloc_id: AllocId,
) -> Vec<(usize, Int<'z3>)>
pub(crate) fn alloc_byte_values( &self, alloc_id: AllocId, ) -> Vec<(usize, Int<'z3>)>
Enumerate (offset, term) pairs for the written bytes of an allocation,
in ascending offset order.
Sourcepub(crate) fn alloc_nul_offsets(&self, alloc_id: AllocId) -> Vec<usize>
pub(crate) fn alloc_nul_offsets(&self, alloc_id: AllocId) -> Vec<usize>
Offsets known to be NUL.
Sourcepub(crate) fn alloc_non_nul_offsets(&self, alloc_id: AllocId) -> Vec<usize>
pub(crate) fn alloc_non_nul_offsets(&self, alloc_id: AllocId) -> Vec<usize>
Offsets known to be non-NUL.
Sourcepub(crate) fn copy_byte_tracking(
&mut self,
src: AllocId,
src_offset: usize,
dst: AllocId,
)
pub(crate) fn copy_byte_tracking( &mut self, src: AllocId, src_offset: usize, dst: AllocId, )
Copy the per-byte state (values + written-offset bound) of one allocation
to another, shifting by src_offset so dst[i] = src[i + src_offset].
Sourcepub(crate) fn load_value(
&self,
alloc_id: AllocId,
view_ty: Ty<'tcx>,
path: &[usize],
) -> Option<&VmValue<'z3, 'tcx>>
pub(crate) fn load_value( &self, alloc_id: AllocId, view_ty: Ty<'tcx>, path: &[usize], ) -> Option<&VmValue<'z3, 'tcx>>
The value at a field offset within an allocation viewed as view_ty.
This is the memory-contents (typed-value) layer (MemoryContent::values): the
single source of truth for field values. Self::field_value is the
local-facing wrapper that resolves a MIR local’s backing allocation and
declared type, then reads this same layer. The viewed type is part of the
key so reinterpret casts (LeafNode ↔ InternalNode) resolve to the
right field view.
Sourcepub(crate) fn store_value(
&mut self,
alloc_id: AllocId,
view_ty: Ty<'tcx>,
path: Vec<usize>,
value: VmValue<'z3, 'tcx>,
)
pub(crate) fn store_value( &mut self, alloc_id: AllocId, view_ty: Ty<'tcx>, path: Vec<usize>, value: VmValue<'z3, 'tcx>, )
Store a value at a field offset within an allocation viewed as view_ty.
This is the write counterpart to Self::load_value on the same
memory-contents layer (MemoryContent::values); the viewed type is part of the
key so reinterpret casts resolve to the right field view.
Sourcepub(crate) fn utf8_validity(&self, alloc_id: AllocId) -> Option<Bool<'z3>>
pub(crate) fn utf8_validity(&self, alloc_id: AllocId) -> Option<Bool<'z3>>
Encode the UTF-8 validity DFA over this allocation’s tracked bytes.
Returns None when no bytes are tracked (validity is trivially
satisfied), so callers can short-circuit to “proved”.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn find_local_by_address(&self, term: &Int<'z3>) -> Option<Local>
pub(crate) fn find_local_by_address(&self, term: &Int<'z3>) -> Option<Local>
Find the local whose symbolic address matches term (the address a
reference value points at). Used to resolve a &self/&mut self
receiver (often a reborrow temp) back to the referent local that carries
the materialized field values.
pub(crate) fn write_through_pointer( &mut self, pointer: &VmValue<'z3, 'tcx>, path: Vec<usize>, value: VmValue<'z3, 'tcx>, ) -> bool
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn begin_method_call( &self, method: DefId, receiver: &VmValue<'z3, 'tcx>, receiver_local: Option<Local>, ) -> Option<MethodSnapshot<'z3, 'tcx>>
pub(crate) fn finish_method_call( &mut self, snapshot: Option<MethodSnapshot<'z3, 'tcx>>, result: Option<&VmValue<'z3, 'tcx>>, )
pub(crate) fn cached_method_result( &self, method: DefId, receiver: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>
fn method_snapshot_matches(&self, snapshot: &MethodSnapshot<'z3, 'tcx>) -> bool
fn snapshot_field(&self, value: &VmValue<'z3, 'tcx>) -> FieldSnapshot<'z3, 'tcx>
fn field_matches( &self, value: &VmValue<'z3, 'tcx>, old: &FieldSnapshot<'z3, 'tcx>, ) -> bool
fn method_owner_local(&self, receiver: &VmValue<'z3, 'tcx>) -> Option<Local>
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn apply_function_var_effect(
&mut self,
args: &[VmValue<'z3, 'tcx>],
caller_arg_locals: &[Option<Local>],
dest: Local,
callee: DefId,
)
pub(crate) fn apply_function_var_effect( &mut self, args: &[VmValue<'z3, 'tcx>], caller_arg_locals: &[Option<Local>], dest: Local, callee: DefId, )
Abstract a safe Fn* call when only a scalar boolean or Ordering
result is required. The closure body is unavailable at a generic call
site, so every allocation outside the active frame may have been
reached through captures or globals. Locals explicitly passed by
reference are also invalidated. Frame-private counters remain stable.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(super) fn prepare_comparison( &self, callee: Option<DefId>, args: &[VmValue<'z3, 'tcx>], destination: Local, ) -> Option<ComparisonPlan<'z3>>
pub(super) fn apply_comparison( &mut self, plan: ComparisonPlan<'z3>, destination: Local, )
Sourcefn scalar_comparison(
&self,
method: ComparisonMethod,
left: &VmValue<'z3, 'tcx>,
right: &VmValue<'z3, 'tcx>,
) -> Option<Bool<'z3>>
fn scalar_comparison( &self, method: ComparisonMethod, left: &VmValue<'z3, 'tcx>, right: &VmValue<'z3, 'tcx>, ) -> Option<Bool<'z3>>
A reference to a primitive scalar compares its stored value, not its address. Floats are excluded because this integer model cannot express NaN.
Sourcefn byte_slice_eq(
&self,
left: &VmValue<'z3, 'tcx>,
right: &VmValue<'z3, 'tcx>,
) -> Option<Bool<'z3>>
fn byte_slice_eq( &self, left: &VmValue<'z3, 'tcx>, right: &VmValue<'z3, 'tcx>, ) -> Option<Bool<'z3>>
Compare a tracked [u8] view with a fully materialized constant byte
array. The result is len == N && bytes[0..N] == constant.
fn byte_slice_const_eq( &self, slice: &VmValue<'z3, 'tcx>, constant: &VmValue<'z3, 'tcx>, ) -> Option<Bool<'z3>>
fn constant_bytes(&self, value: &VmValue<'z3, 'tcx>) -> Option<Vec<u8>>
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn materialize_constructor_result( &mut self, destination: Local, args: &[VmValue<'z3, 'tcx>], first_operand: Option<&Operand<'tcx>>, callee: DefId, has_invariant: bool, )
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(super) fn apply_memory_effect( &mut self, effect: &CallEffect, args: &[VmValue<'z3, 'tcx>], dest: Local, )
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
fn apply_binary_num( &mut self, dest: Local, args: &[VmValue<'z3, 'tcx>], lhs_arg: usize, rhs_arg: usize, f: impl Fn(&Int<'z3>, &Int<'z3>) -> Int<'z3>, )
pub(super) fn apply_numeric_effect( &mut self, effect: &CallEffect, args: &[VmValue<'z3, 'tcx>], dest: Local, )
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(super) fn apply_simd_effect( &mut self, effect: &CallEffect, args: &[VmValue<'z3, 'tcx>], caller_arg_locals: &[Option<Local>], dest: Local, )
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
fn set_dest_as_heap_ptr(&mut self, arg_val: &VmValue<'z3, 'tcx>, dest: Local)
pub(crate) fn apply_call_effect( &mut self, effect: &CallEffect, args: &[VmValue<'z3, 'tcx>], caller_arg_locals: &[Option<Local>], call_args: &[Spanned<Operand<'tcx>>], dest: Local, func: &Operand<'tcx>, )
fn simd_lane_type(&self, ty: Ty<'tcx>) -> Option<(Ty<'tcx>, usize)>
fn set_opaque_simd_result(&mut self, dest: Local)
fn copy_simd_result_from_local(&mut self, dest: Local, source: Local) -> bool
fn set_opaque_intrinsic_result(&mut self, dest: Local)
fn set_external_container_result( &mut self, dest: Local, alloc_id: AllocId, base: Int<'z3>, elem_ty: Option<Ty<'tcx>>, ) -> Option<VmValue<'z3, 'tcx>>
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(super) fn prepare_builtin_index( &self, callee: Option<DefId>, args: &[VmValue<'z3, 'tcx>], arg_locals: &[Option<Local>], dest: Local, ) -> Option<BuiltinIndexPlan<'z3, 'tcx>>
pub(super) fn apply_builtin_index( &mut self, plan: BuiltinIndexPlan<'z3, 'tcx>, dest: Local, )
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
fn select_call_model( &self, site: &CallSite<'_, 'z3, 'tcx>, drop_call: Option<DropCall>, ) -> CallModel<'z3, 'tcx>
fn execute_call_model( &mut self, model: CallModel<'z3, 'tcx>, site: &CallSite<'_, 'z3, 'tcx>, ) -> RuleFlow
fn finish_call( &mut self, site: &CallSite<'_, 'z3, 'tcx>, prior_result: Option<&Int<'z3>>, summary_used: bool, method_call: Option<MethodSnapshot<'z3, 'tcx>>, )
fn finish_call_state( &mut self, site: &CallSite<'_, 'z3, 'tcx>, prior_result: Option<&Int<'z3>>, summary_used: bool, method_call: Option<MethodSnapshot<'z3, 'tcx>>, )
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcefn provenance_for_binary_op(
&self,
op: BinOp,
lhs: &VmValue<'z3, 'tcx>,
rhs: &VmValue<'z3, 'tcx>,
) -> Option<Provenance<'z3>>
fn provenance_for_binary_op( &self, op: BinOp, lhs: &VmValue<'z3, 'tcx>, rhs: &VmValue<'z3, 'tcx>, ) -> Option<Provenance<'z3>>
Compute provenance for a binary operation on pointer values.
Propagates provenance with adjusted offset for pointer arithmetic
(ptr + offset, ptr - offset, Offset).
Sourcefn facts_for_binary_op(
&self,
op: BinOp,
lhs: &VmValue<'z3, 'tcx>,
rhs: &VmValue<'z3, 'tcx>,
provenance: &Option<Provenance<'z3>>,
) -> ValueFacts<'z3>
fn facts_for_binary_op( &self, op: BinOp, lhs: &VmValue<'z3, 'tcx>, rhs: &VmValue<'z3, 'tcx>, provenance: &Option<Provenance<'z3>>, ) -> ValueFacts<'z3>
Compute facts for a binary operation. Propagates non_null from pointer arithmetic and align_n from compatible ops.
Sourcefn rhs_is_aligned_multiple(
&self,
val: &VmValue<'z3, 'tcx>,
align: &Int<'z3>,
) -> bool
fn rhs_is_aligned_multiple( &self, val: &VmValue<'z3, 'tcx>, align: &Int<'z3>, ) -> bool
Check if a value is known to be a multiple of align (e.g. the result
of a Mul by a constant factor of align).
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcefn record_projected_store(
&mut self,
place: &Place<'tcx>,
value: &VmValue<'z3, 'tcx>,
)
fn record_projected_store( &mut self, place: &Place<'tcx>, value: &VmValue<'z3, 'tcx>, )
Record byte-level values when assigning to a place with projections.
This handles patterns like buf[i] = 0u8 (nul-store) and arr[i] = val.
Sourcefn record_indexed_store(
&mut self,
place: &Place<'tcx>,
value: &VmValue<'z3, 'tcx>,
)
fn record_indexed_store( &mut self, place: &Place<'tcx>, value: &VmValue<'z3, 'tcx>, )
Track byte-level values for index-based stores (e.g. buf[i] = 0u8)
that record_projected_store skips due to Index projections.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcefn op_source_of(
&self,
pk: &PlaceKey,
) -> Option<(Option<PlaceKey>, Option<PlaceKey>, BinOp)>
fn op_source_of( &self, pk: &PlaceKey, ) -> Option<(Option<PlaceKey>, Option<PlaceKey>, BinOp)>
The (lhs, rhs, op) of the binary-op/comparison source recorded on the
value bound to pk’s local, if any.
fn operand_place_key(op: &Operand<'tcx>) -> Option<PlaceKey>
Sourcefn infer_guard_align(&mut self, cond: &Operand<'tcx>, expected: bool)
fn infer_guard_align(&mut self, cond: &Operand<'tcx>, expected: bool)
Infer alignment constraints from guards of the form (x % n) == 0.
fn mark_align_n(&mut self, src_pk: &Option<PlaceKey>, align: Int<'z3>)
Sourcefn infer_guard_non_null(&mut self, cond: &Operand<'tcx>, expected: bool)
fn infer_guard_non_null(&mut self, cond: &Operand<'tcx>, expected: bool)
Infer non_null invariants from branch guards.
Sourcefn infer_switch_guard(&mut self, discr: &Operand<'tcx>)
fn infer_switch_guard(&mut self, discr: &Operand<'tcx>)
Infer non_null from SwitchInt discriminant.
fn mark_guard_pointer(&mut self, lhs: &Option<PlaceKey>, rhs: &Option<PlaceKey>)
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(super) fn init_struct_param(
&mut self,
local: Local,
ty: Ty<'tcx>,
local_idx: usize,
invariants: &mut ValueFacts<'z3>,
) -> bool
pub(super) fn init_struct_param( &mut self, local: Local, ty: Ty<'tcx>, local_idx: usize, invariants: &mut ValueFacts<'z3>, ) -> bool
Initialize a struct/tuple/enum parameter (a non-Box/Vec ADT):
decompose it into per-field symbolic values for field-level checking.
Sourcepub(crate) fn init_box_vec_param(
&mut self,
local: Local,
ty: Ty<'tcx>,
local_idx: usize,
invariants: &mut ValueFacts<'z3>,
) -> bool
pub(crate) fn init_box_vec_param( &mut self, local: Local, ty: Ty<'tcx>, local_idx: usize, invariants: &mut ValueFacts<'z3>, ) -> bool
Initialize a Box/Vec/CString parameter: allocate its heap pointee,
expose the owning pointer field, and (for Vec) bind symbolic
len/cap.
Sourcepub(super) fn init_array_param(
&mut self,
local: Local,
ty: Ty<'tcx>,
local_idx: usize,
invariants: &mut ValueFacts<'z3>,
) -> bool
pub(super) fn init_array_param( &mut self, local: Local, ty: Ty<'tcx>, local_idx: usize, invariants: &mut ValueFacts<'z3>, ) -> bool
Initialize an array parameter ([T; N]): give it a real allocation with
provenance so downstream call effects can record the alloc_id.
Sourcepub(super) fn init_reference_param(
&mut self,
local: Local,
ty: Ty<'tcx>,
local_idx: usize,
invariants: &mut ValueFacts<'z3>,
) -> bool
pub(super) fn init_reference_param( &mut self, local: Local, ty: Ty<'tcx>, local_idx: usize, invariants: &mut ValueFacts<'z3>, ) -> bool
Initialize a reference parameter (&T, &mut T): create a symbolic
allocation for the pointee, attach provenance, and (for a struct pointee)
materialize its pointer/scalar fields.
Sourcepub(super) fn propagate_entry_block_provenance(&mut self)
pub(super) fn propagate_entry_block_provenance(&mut self)
Propagate parameter provenance through the entry block’s simple
assignments (_tmp = _1, _tmp = _1 as *const T), which the backward
slicer may omit as same-block definitions.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn init_parameters(&mut self)
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn apply_slice_offset( &mut self, dest: Local, base: &VmValue<'z3, 'tcx>, index: &VmValue<'z3, 'tcx>, index_local: Local, ) -> bool
pub(crate) fn slice_index_start( &self, index: &VmValue<'z3, 'tcx>, index_local: Local, ) -> Option<Int<'z3>>
pub(crate) fn slice_index_output_len( &self, base: &VmValue<'z3, 'tcx>, index: &VmValue<'z3, 'tcx>, index_local: Local, ) -> Option<Int<'z3>>
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn has_available_transfer(&self, alloc_id: AllocId) -> bool
pub(crate) fn begin_ownership_transfer(&mut self, local: Local, owner: DefId)
pub(crate) fn record_memory_drop(&mut self, alloc_id: AllocId, local: Local)
pub(crate) fn record_memory_use(&self, alloc_id: AllocId, local: Local)
pub(crate) fn scalar_bits_term( &self, ty: Ty<'tcx>, bits: u128, ) -> Option<Int<'z3>>
pub(crate) fn u128_term(&self, value: u128) -> Int<'z3>
pub(crate) fn enum_discriminant_term( &self, ty: Ty<'tcx>, variant: VariantIdx, ) -> Option<Int<'z3>>
Sourcepub(crate) fn body(&self) -> &'tcx Body<'tcx>
pub(crate) fn body(&self) -> &'tcx Body<'tcx>
MIR for the current frame, preferring its selected generic instantiation.
pub(crate) fn body_for(&self, def_id: DefId) -> &'tcx Body<'tcx>
Sourcepub(crate) fn target_body(&self) -> &Body<'tcx>
pub(crate) fn target_body(&self) -> &Body<'tcx>
MIR for the verification target, preferring its selected generic instantiation.
pub(crate) fn record_unsupported(&mut self, operation: &str)
pub(crate) fn record_unsupported_effect(&mut self, effect: &str)
pub(crate) fn record_missing_mir(&mut self, callee: DefId)
pub(crate) fn record_opaque_control_flow(&mut self, operation: &str)
Sourcepub(crate) fn enter_frame(
&mut self,
callee: DefId,
body: Option<&'tcx Body<'tcx>>,
) -> FrameState<'tcx>
pub(crate) fn enter_frame( &mut self, callee: DefId, body: Option<&'tcx Body<'tcx>>, ) -> FrameState<'tcx>
Capture the frame-scoped state before switching to an inlined callee.
This is the single source of truth for what is frame-scoped: the whole
FrameState (function identity, local bindings, and operand sources).
Both inline mechanisms (handle_callee_entry in path replay and
exec_inline_call) call this, so they can no longer drift apart.
Sourcepub(crate) fn restore_frame(&mut self, frame: FrameState<'tcx>)
pub(crate) fn restore_frame(&mut self, frame: FrameState<'tcx>)
Restore the frame-scoped state after an inlined callee returns.
Sourcepub(crate) fn local_value(&self, local: Local) -> Option<&VmValue<'z3, 'tcx>>
pub(crate) fn local_value(&self, local: Local) -> Option<&VmValue<'z3, 'tcx>>
Look up the whole value bound to a MIR local (its path == [] slot in
the allocation backing the local).
pub(crate) fn term_involves( terms: &FxHashSet<Int<'z3>>, term: &Int<'z3>, ) -> bool
Sourcepub(crate) fn set_local(&mut self, local: Local, value: VmValue<'z3, 'tcx>)
pub(crate) fn set_local(&mut self, local: Local, value: VmValue<'z3, 'tcx>)
Bind a whole value to a MIR local (store it at path == [] in the
allocation backing the local, allocating that stack slot on demand).
pub(crate) fn invalidate_indexed_array(&mut self, local: Local)
Sourcepub(crate) fn mark_initialized(&mut self, value: &mut VmValue<'z3, 'tcx>)
pub(crate) fn mark_initialized(&mut self, value: &mut VmValue<'z3, 'tcx>)
Mark a value as initialized (written), and sync its backing allocation’s
ContentFacts::initialized fact.
This is the single entry point that keeps the value-level
ValueFacts::init and the allocation-level ContentFacts::initialized
in sync; callers must set the pair through here rather than by hand so
the two facts cannot drift apart.
Sourcepub(crate) fn local_address(&mut self, local: Local) -> Int<'z3>
pub(crate) fn local_address(&mut self, local: Local) -> Int<'z3>
Get the symbolic address of a MIR local (its stack allocation’s base).
Sourcepub(crate) fn allocate(
&mut self,
size: Int<'z3>,
align: Int<'z3>,
element_ty: Option<Ty<'tcx>>,
) -> (AllocId, Int<'z3>)
pub(crate) fn allocate( &mut self, size: Int<'z3>, align: Int<'z3>, element_ty: Option<Ty<'tcx>>, ) -> (AllocId, Int<'z3>)
Allocate a fresh symbolic object and return its ID and base address.
Sourcepub(crate) fn allocate_external(
&mut self,
size: Int<'z3>,
align: Int<'z3>,
element_ty: Option<Ty<'tcx>>,
) -> (AllocId, Int<'z3>)
pub(crate) fn allocate_external( &mut self, size: Int<'z3>, align: Int<'z3>, element_ty: Option<Ty<'tcx>>, ) -> (AllocId, Int<'z3>)
Allocate a fresh external allocation (for raw-pointer parameters). External allocations may be null and have unlimited size.
Sourcepub(crate) fn allocate_slice(
&mut self,
len: Int<'z3>,
elem_size: Int<'z3>,
align: Int<'z3>,
element_ty: Option<Ty<'tcx>>,
) -> (AllocId, Int<'z3>)
pub(crate) fn allocate_slice( &mut self, len: Int<'z3>, elem_size: Int<'z3>, align: Int<'z3>, element_ty: Option<Ty<'tcx>>, ) -> (AllocId, Int<'z3>)
Allocate a slice/array data allocation with a known (possibly symbolic)
element count. Computes size = len * elem_size and materializes len
in one step, so size and the slice length can never diverge (the
size == len * elem_size invariant is established here instead of being
re-derived by every caller).
fn allocate_internal( &mut self, size: Int<'z3>, align: Int<'z3>, element_ty: Option<Ty<'tcx>>, kind: AllocKind<'z3>, ) -> (AllocId, Int<'z3>)
Sourcepub(crate) fn alloc(&self, id: AllocId) -> &Allocation<'z3, 'tcx>
pub(crate) fn alloc(&self, id: AllocId) -> &Allocation<'z3, 'tcx>
Indexed access to an allocation by its AllocId (the id is the index).
Sourcepub(crate) fn alloc_mut(&mut self, id: AllocId) -> &mut Allocation<'z3, 'tcx>
pub(crate) fn alloc_mut(&mut self, id: AllocId) -> &mut Allocation<'z3, 'tcx>
Mutable indexed access to an allocation by its AllocId.
Sourcepub(crate) fn content(&self, id: AllocId) -> &MemoryContent<'z3, 'tcx>
pub(crate) fn content(&self, id: AllocId) -> &MemoryContent<'z3, 'tcx>
Indexed access to an allocation’s contents by its AllocId.
Sourcepub(crate) fn content_mut(
&mut self,
id: AllocId,
) -> &mut MemoryContent<'z3, 'tcx>
pub(crate) fn content_mut( &mut self, id: AllocId, ) -> &mut MemoryContent<'z3, 'tcx>
Mutable indexed access to an allocation’s contents by its AllocId.
Sourcepub(crate) fn is_cstr_trusted(&self, id: AllocId) -> bool
pub(crate) fn is_cstr_trusted(&self, id: AllocId) -> bool
Whether id was asserted a valid C string via a ValidCStr contract
fact / struct invariant.
Sourcepub(crate) fn is_utf8_trusted(&self, id: AllocId) -> bool
pub(crate) fn is_utf8_trusted(&self, id: AllocId) -> bool
Whether id was asserted valid UTF-8 via a ValidString contract fact.
Sourcepub(crate) fn root_alloc(&self, id: AllocId) -> AllocId
pub(crate) fn root_alloc(&self, id: AllocId) -> AllocId
The ultimate root allocation, following parent chains (sub-allocations
created by from_raw_parts / split_at / as_chunks, whose parent
points at the allocation they were split from).
Sourcepub(crate) fn fresh_int(&self, prefix: &str) -> Int<'z3>
pub(crate) fn fresh_int(&self, prefix: &str) -> Int<'z3>
Create a fresh symbolic Z3 int constant (globally unique, even across
calls with the same prefix — Z3_mk_fresh_const auto-suffixes the name).
Sourcepub(crate) fn field_value(
&self,
local: Local,
path: &[usize],
) -> Option<&VmValue<'z3, 'tcx>>
pub(crate) fn field_value( &self, local: Local, path: &[usize], ) -> Option<&VmValue<'z3, 'tcx>>
Get the value of a specific field within an aggregate local.
Field values live in the allocation backing the local (the
memory-contents layer MemoryContent::values), keyed by the local’s declared
type as the view type. Returns None if the local has no allocation
(the field was never materialized).
Sourcepub(crate) fn field_paths(&self, local: Local) -> Vec<Vec<usize>>
pub(crate) fn field_paths(&self, local: Local) -> Vec<Vec<usize>>
Enumerate the field paths materialized for a local: every non-empty
path for which Self::field_value currently returns a value (the
local’s allocation’s fields under its declared view type). The whole
value (path == []) is deliberately excluded — it is read via
Self::local_value, not as a “field”, so callers iterating fields do
not accidentally treat the whole value as a field projection.
Sourcepub(crate) fn frame_local_ty(
&self,
frame: &FrameState<'tcx>,
local: Local,
) -> Ty<'tcx>
pub(crate) fn frame_local_ty( &self, frame: &FrameState<'tcx>, local: Local, ) -> Ty<'tcx>
The declared type of local in frame’s body.
Sourcepub(crate) fn frame_field_paths(
&self,
frame: &FrameState<'tcx>,
local: Local,
) -> Vec<Vec<usize>>
pub(crate) fn frame_field_paths( &self, frame: &FrameState<'tcx>, local: Local, ) -> Vec<Vec<usize>>
Enumerate the field paths materialized for local in a saved caller
frame. Field values live in the path-scoped MemoryContent::values, so they
are read via frame’s local_alloc and declared type.
Sourcepub(crate) fn frame_field_value(
&self,
frame: &FrameState<'tcx>,
local: Local,
path: &[usize],
) -> Option<&VmValue<'z3, 'tcx>>
pub(crate) fn frame_field_value( &self, frame: &FrameState<'tcx>, local: Local, path: &[usize], ) -> Option<&VmValue<'z3, 'tcx>>
Read a field of local in a saved caller frame.
Sourcepub(crate) fn frame_local_value(
&self,
frame: &FrameState<'tcx>,
local: Local,
) -> Option<&VmValue<'z3, 'tcx>>
pub(crate) fn frame_local_value( &self, frame: &FrameState<'tcx>, local: Local, ) -> Option<&VmValue<'z3, 'tcx>>
Read the whole value of local in a saved caller frame (its
path == [] slot). The value lives in the path-scoped MemoryContent::values,
while the name → allocation binding lives in the saved frame.
Sourcepub(crate) fn all_local_values(&self) -> Vec<(Local, &VmValue<'z3, 'tcx>)>
pub(crate) fn all_local_values(&self) -> Vec<(Local, &VmValue<'z3, 'tcx>)>
Enumerate (local, whole value) for every local with a materialized
whole value (its path == [] slot). This is the whole-value counterpart
to Self::field_paths, used where code used to iterate locals.
Sourcepub(crate) fn owner_ptr_field(
&self,
local: Local,
) -> Option<&VmValue<'z3, 'tcx>>
pub(crate) fn owner_ptr_field( &self, local: Local, ) -> Option<&VmValue<'z3, 'tcx>>
The field carrying an owned value’s heap pointer (Box/Vec/String’s
owning pointer field), located generically via
Self::container_ptr_field (e.g. Box → [0, 0], Vec → [0, 0, 0]).
Falls back to the first materialized field with heap provenance for
owners whose deep NonNull leaf was not explicitly materialized (e.g. a
Box produced by into_boxed_slice, which only records the whole value).
Sourcepub(crate) fn invalidate_owner_field(&mut self, local: Local)
pub(crate) fn invalidate_owner_field(&mut self, local: Local)
Invalidate local’s owner-field provenance (mark it moved-out after a
whole-place move), so a later Owning check does not treat it as a
second owner of the heap allocation it no longer owns.
Sourcepub(crate) fn set_field_value(
&mut self,
local: Local,
path: Vec<usize>,
value: VmValue<'z3, 'tcx>,
)
pub(crate) fn set_field_value( &mut self, local: Local, path: Vec<usize>, value: VmValue<'z3, 'tcx>, )
Set the value of a specific field within an aggregate local.
Ensures the local has a backing allocation, then stores into the
memory-contents layer (MemoryContent::values) keyed by the local’s declared
type as the view type.
pub(crate) fn write_local_path( &mut self, local: Local, path: Vec<usize>, value: VmValue<'z3, 'tcx>, )
pub(crate) fn invalidate_field_descendants( &mut self, local: Local, path: &[usize], )
Sourcepub(crate) fn assert_all(&self, solver: &Solver<'z3>)
pub(crate) fn assert_all(&self, solver: &Solver<'z3>)
Assert path conditions and invariant constraints into a solver.
pub(crate) fn assert_path_constraints(&self, solver: &Solver<'z3>)
Sourcefn assert_value_constraints(
&self,
solver: &Solver<'z3>,
value: &VmValue<'z3, 'tcx>,
)
fn assert_value_constraints( &self, solver: &Solver<'z3>, value: &VmValue<'z3, 'tcx>, )
Assert a single symbolic value’s known invariant constraints.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
pub(crate) fn indexed_element_target( &self, place: &Place<'tcx>, ) -> Option<(AllocId, Int<'z3>)>
pub(crate) fn store_indexed_element( &mut self, alloc_id: AllocId, index: Int<'z3>, value: VmValue<'z3, 'tcx>, )
pub(crate) fn store_repeated_indexed_elements( &mut self, alloc_id: AllocId, base: Int<'z3>, count: u64, value: VmValue<'z3, 'tcx>, )
pub(crate) fn path_implies(&self, condition: &Bool<'z3>) -> bool
fn stored_indexed_element( &self, place: &Place<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>
pub(crate) fn symbolic_const_term(&self, constant: &Const<'tcx>) -> Int<'z3>
pub(crate) fn symbolic_const_term_text(&self, text: &str) -> Int<'z3>
pub(crate) fn const_param_term(&self, index: u32) -> Option<Int<'z3>>
Sourcepub(crate) fn value_of_operand(
&self,
operand: &Operand<'tcx>,
) -> VmValue<'z3, 'tcx>
pub(crate) fn value_of_operand( &self, operand: &Operand<'tcx>, ) -> VmValue<'z3, 'tcx>
Extract a VmValue from a MIR operand.
pub(crate) fn materialize_const_adt( &mut self, local: Local, constant: &Const<'tcx>, )
fn const_field_term(&self, val: &ConstValue, ty: Ty<'tcx>) -> Int<'z3>
Sourcefn byte_from_field(
&self,
alloc_id: AllocId,
ty: Ty<'tcx>,
offset: usize,
) -> Option<Int<'z3>>
fn byte_from_field( &self, alloc_id: AllocId, ty: Ty<'tcx>, offset: usize, ) -> Option<Int<'z3>>
Read the byte at offset within a repr(C)-style ADT from its
materialized scalar field values — the field→byte direction of the cast
cross-view materialization. Returns None when offset does not land
inside a concrete scalar field (so the caller falls back to the base).
Sourcepub(crate) fn value_of_place(
&self,
place: &Place<'tcx>,
) -> Option<VmValue<'z3, 'tcx>>
pub(crate) fn value_of_place( &self, place: &Place<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>
Look up the value stored at a MIR place.
Sourcefn is_len_field_read(&self, ty: Ty<'tcx>, field_path: &[usize]) -> bool
fn is_len_field_read(&self, ty: Ty<'tcx>, field_path: &[usize]) -> bool
Whether field_path selects a length field.
pub(super) fn is_cap_field_read( &self, ty: Ty<'tcx>, field_path: &[usize], ) -> bool
Sourcepub(crate) fn unknown_value_for_place(
&self,
place: &Place<'tcx>,
) -> VmValue<'z3, 'tcx>
pub(crate) fn unknown_value_for_place( &self, place: &Place<'tcx>, ) -> VmValue<'z3, 'tcx>
Create an unknown value for a place.
The value carries no non_null (or any other) assumption: a raw pointer
whose provenance was lost may still be null, so assuming non-null here
would let NonNull/null-guard checks pass unsoundly.
Source§impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>
Sourcepub(crate) fn has_alias_hazard(&self, alloc_id: AllocId) -> bool
pub(crate) fn has_alias_hazard(&self, alloc_id: AllocId) -> bool
Whether a declared alias contract accepts this allocation’s root.
Sourcepub(crate) fn new(
z3_ctx: &'z3 Context,
tcx: TyCtxt<'tcx>,
target_def_id: DefId,
instantiated_target_body: Option<&'tcx Body<'tcx>>,
constructor_mir_mode: ConstructorMirMode,
) -> Self
pub(crate) fn new( z3_ctx: &'z3 Context, tcx: TyCtxt<'tcx>, target_def_id: DefId, instantiated_target_body: Option<&'tcx Body<'tcx>>, constructor_mir_mode: ConstructorMirMode, ) -> Self
Create an executor with fresh state for one path.
Trait Implementations§
Source§impl<'z3, 'tcx> Clone for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> Clone for VmExecutor<'z3, 'tcx>
Auto Trait Implementations§
impl<'z3, 'tcx> !DynSend for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> !DynSync for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> !Freeze for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> !RefUnwindSafe for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> !Send for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> !Sync for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> !UnwindSafe for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> Forget for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> Move for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> Unpin for VmExecutor<'z3, 'tcx>
impl<'z3, 'tcx> UnsafeUnpin for VmExecutor<'z3, 'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more