Expand description
Supporting symbolic VM state types and operations.
Symbolic values, memory allocations, and operations on VmExecutor live
here; the core state and its constructor are defined in the parent module.
Re-exportsΒ§
use crate::def_ids::type_ids;πuse crate::util::mir_utils;πuse rustc_abi::VariantIdx;πuse rustc_hir::def_id::DefId;πuse rustc_middle::mir::Body;πuse rustc_middle::mir::ConstValue;πuse rustc_middle::mir::Local;πuse rustc_middle::mir::Operand;πuse rustc_middle::mir::Place;πuse rustc_middle::mir::ProjectionElem;πuse rustc_middle::ty::Region;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyKind;πuse rustc_middle::ty::TypingEnv;πuse rustc_span::Span;πuse z3::SatResult;πuse z3::Solver;πuse z3::ast::Array;πuse z3::ast::Ast;πuse z3::ast::Bool;πuse z3::ast::Dynamic;πuse z3::ast::Int;πuse crate::compat::FxHashMap;πuse crate::compat::FxHashSet;πpub(crate) use super::VmExecutor;πuse crate::util::def_use::PlaceKey;π
StructsΒ§
- Alloc
Facts π - Per-allocation lifecycle facts (
dead/liveness/for_each), kept apart from the allocationβs shape metadata andparentedge so identity/layout and facts are separated at the type level. The content facts (readability, C-string/UTF-8 trust) live onContentFactsinstead. - AllocId π
- Unique identifier for a heap or stack allocation.
- Allocation π
- A memory allocation: a stack local, a heap object (
Box/Vec), or an external raw-pointer placeholder. - Constraints π
- Accumulated solver state for the current path.
- Content
Facts π - Per-allocation content facts: whether the allocationβs contents are
readable (initialized), whether they were asserted to be a valid C string /
UTF-8, and whether they were licensed for
SplitTransmutere-interpretation. These describe the stored bytes/values, so they live onMemoryContentnext to that data, rather than onAllocFacts(lifecycle). - ForEach
Facts π - Uniform facts about the pointer elements of a container, established by
x.iter()for_each invariants. - Frame
State π - The frame-scoped subset of
VmExecutor: the name β allocation binding keyed by MIRLocal, which the callee reuses, so it must be swapped out for the duration of an inlined callee and swapped back afterwards. - Inline
Ctx π - Scratch state shared by recursive inlining and path replay.
Recursive inlining saves caller bindings on the Rust call stack; path replay
saves them with the caller frame in
SavedCallerFrame. - Memory
Content π - The per-allocation byte and typed-value layers. Typed values use a view type
so fields from different casts do not collide. Unwritten bytes read as the
UNINITsentinel. - Memory
Event π - Memory
Unit π - A single allocation: its shape metadata (
Allocation) plus its contents (MemoryContent). Splitting the two keeps the identity/layout facts apart from the mutable memory the values live in, while colocating them in one unit so no parallel table can drift out of sync. Facts live in three anchored layers β lifecycle (AllocFacts), content (ContentFacts), and value (ValueFactson eachVmValue) β see each typeβs doc. - Ownership
Transfer π - A transferable ownership share. Copies of its pointer use the same entry.
- Provenance π
- Pointer provenance: which allocation, at what byte offset, and (when known) what structure that offset has.
- Saved
Caller πFrame - Caller state parked during a path-replay call.
- Term
Caches π - Term-provenance caches, one per phenomenon the VM must shape by hand.
- Value
Facts π - Value-level facts about a single symbolic value (nullness, alignment,
bounds, and whether it has been written). These travel with the value β a
VmValueleaves its allocation when passed as an operand or stashed inInlineCtx::deferred_field_writesβ so they live on the value, not the allocation. The allocation-level counterpart toinitisContentFacts::initialized, kept in sync byVmExecutor::mark_initialized. - VmValue π
- A symbolic value tracked by the VM.
EnumsΒ§
- Alloc
Kind π - The shape of an allocation: a single object, a slice/array buffer, or an
external raw-pointer parameter.
element_ty(typed vs untyped) and theparentsub-view edge stay separate fields. - Element
Ty π - The element type of an allocationβs contents, either a concrete [
Ty] or symbolic (Generic). - Memory
Event πKind - Memory operations observed while executing a MIR path.
- Offset
Kind π - The structure of a pointerβs byte offset, when it has one.
- Value
Source π - The extra semantics attached to a value, beyond its term/type/provenance.