Documentation

Miri.Memory.Access

The allocation-bounds and pointer-alignment helpers from the pinned rustc_const_eval/src/interpret/memory.rs. Pointer-to-allocation resolution, live-allocation lookup, and machine policy are explicit inputs: this module does not infer liveness or dereference validity from an allocation ID alone.

Instances For
    Equations
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Instances For
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Instances For
                    Equations
                    Instances For
                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Instances For
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            Instances For
                              Equations
                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  @[instance_reducible]
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  structure Miri.Memory.ResolvedPointer (ProvExtra : Type) :
                                  Instances For
                                    structure Miri.Memory.CheckedPointerAccess (ProvExtra : Type) :
                                    Instances For
                                      @[reducible, inline]
                                      abbrev Miri.Memory.PointerResolver (Prov ProvExtra : Type) :
                                      Equations
                                      Instances For
                                        def Miri.Memory.checkedBounds (target : PointerArithmetic) (id : AllocId) (allocationSize offset : ABI.Size) (signedSize : Int) (message : CheckInAllocMsg) :
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          def Miri.Memory.checkAndDerefPtr {Prov ProvExtra : Type} (target : PointerArithmetic) (ptr : Pointer (Option Prov)) (signedSize : Int) (message : CheckInAllocMsg) (resolve : PointerResolver Prov ProvExtra) (lookup : LiveAllocationLookup) :

                                          The exact common check_and_deref_ptr order. Zero-sized accesses return none without pointer resolution or allocation lookup. Nonzero accesses first resolve provenance/address, then obtain live allocation metadata, then perform the checked signed interval test. The callbacks are the unported Machine and memory-map dependencies of the source method.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            def Miri.Memory.getPtrAccess {Prov ProvExtra : Type} (target : PointerArithmetic) (ptr : Pointer (Option Prov)) (size : ABI.Size) (message : CheckInAllocMsg) (resolve : PointerResolver Prov ProvExtra) (lookup : LiveAllocationLookup) :

                                            Source get_ptr_access: converting Size to host i64 is checked, then the common dereference/bounds helper supplies the live allocation details.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              def Miri.Memory.checkPtrAccess {Prov ProvExtra : Type} (target : PointerArithmetic) (ptr : Pointer (Option Prov)) (size : ABI.Size) (message : CheckInAllocMsg) (resolve : PointerResolver Prov ProvExtra) (lookup : LiveAllocationLookup) :

                                              Source check_ptr_access, retaining its configurable access diagnostic.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                def Miri.Memory.checkPtrAccessSigned {Prov ProvExtra : Type} (target : PointerArithmetic) (ptr : Pointer (Option Prov)) (size : Int64) (message : CheckInAllocMsg) (resolve : PointerResolver Prov ProvExtra) (lookup : LiveAllocationLookup) :

                                                Source check_ptr_access_signed; a negative amount checks bytes to the left of the pointer, and zero retains the source's no-dereference behavior.

                                                Equations
                                                Instances For
                                                  def Miri.Memory.isPtrMisaligned {Prov ProvExtra : Type} [PointerProvenance Prov] (ptr : Pointer (Option Prov)) (required : ABI.Align) (enforceAlignment : Bool) (resolve : PointerResolver Prov ProvExtra) (lookup : AllocId → Except AllocationLookupError AllocationInfo) (machineAlignmentCheck : AllocId → ABI.Align → AllocationKind → ABI.Size → ABI.Align → Option Misalignment) :

                                                  Source is_ptr_misaligned, factored over explicit resolver, allocation metadata, enforcement policy, and machine-specific alignment hook. For address-based provenance, the pointer offset is its absolute address; for relative provenance, both allocation alignment and relative offset are checked. The hook must be supplied by the selected Machine, including its default None behavior when no machine-specific rule applies.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    def Miri.Memory.checkPtrAlign {Prov ProvExtra : Type} [PointerProvenance Prov] (ptr : Pointer (Option Prov)) (required : ABI.Align) (enforceAlignment : Bool) (resolve : PointerResolver Prov ProvExtra) (lookup : AllocId → Except AllocationLookupError AllocationInfo) (machineAlignmentCheck : AllocId → ABI.Align → AllocationKind → ABI.Size → ABI.Align → Option Misalignment) :

                                                    Source check_ptr_align error boundary. The source message is always CheckAlignMsg::AccessedPtr for this API.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      theorem Miri.Memory.zero_sized_check_skips_resolution {Prov ProvExtra : Type} (ptr : Pointer (Option Prov)) (message : CheckInAllocMsg) (resolve : PointerResolver Prov ProvExtra) (lookup : LiveAllocationLookup) (target : PointerArithmetic) :
                                                      checkAndDerefPtr target ptr 0 message resolve lookup = Except.ok none