Documentation

Miri.Interpreter.MemoryShims

Pinned portable C memory/string arms of shims/foreign_items.rs and the read_c_str helper. Pointer checks are preserved even for zero-byte C accesses. Concrete string scanning has an explicit resource budget, whose exhaustion is Unknown; it is never treated as an empty string or a successful execution.

Instances For
    def Miri.Interpreter.MemoryShims.Hooks.core {P S D MD B I : Type} (h : Hooks P S D MD B I) :
    CoreHooks P S D MD B I
    Equations
    Instances For
      def Miri.Interpreter.MemoryShims.Source.memchr {P S D MD B I : Type} (h : CoreHooks P S D MD B I) (pointer : Memory.Pointer (Option P)) (count : UInt64) (reverse : Bool) (needle : UInt8) :

      Each character is read separately; a match prevents all later accesses.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Miri.Interpreter.MemoryShims.Source.readCString {P S D MD B I : Type} (h : CoreHooks P S D MD B I) (budget : Nat) (pointer : Memory.Pointer (Option P)) :

        Source read_c_str deliberately reads all bytes a second time after the terminator scan, including a zero-length read for the empty string.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Miri.Interpreter.MemoryShims.Source.wcharLength {P S D MD B I : Type} (h : CoreHooks P S D MD B I) (budget : Nat) (pointer : Memory.Pointer (Option P)) :
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Miri.Interpreter.MemoryShims.Source.emulate {P S D MD B I : Type} (h : CoreHooks P S D MD B I) (budget : Nat) (name : String) (abi : ABI.FnAbi MIR.TyId) (args : Array (OpTy P)) (dest : MD) :

            All argument reads and mandatory pointer checks precede actual memory operations in the source order. memset truncates C int to unsigned char.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Miri.Interpreter.MemoryShims.memchr {P S D MD B I : Type} (h : Hooks P S D MD B I) (pointer : Memory.Pointer (Option P)) (count : UInt64) (reverse : Bool) (needle : UInt8) :
              Equations
              Instances For
                def Miri.Interpreter.MemoryShims.readCString {P S D MD B I : Type} (h : Hooks P S D MD B I) (budget : Nat) (pointer : Memory.Pointer (Option P)) :
                Equations
                Instances For
                  def Miri.Interpreter.MemoryShims.wcharLength {P S D MD B I : Type} (h : Hooks P S D MD B I) (budget : Nat) (pointer : Memory.Pointer (Option P)) :
                  Equations
                  Instances For
                    def Miri.Interpreter.MemoryShims.emulate {P S D MD B I : Type} (h : Hooks P S D MD B I) (budget : Nat) (name : String) (abi : ABI.FnAbi MIR.TyId) (args : Array (OpTy P)) (dest : MD) :
                    Equations
                    Instances For
                      def Miri.Interpreter.MemoryShims.bind {P S D MD B I : Type} (h : Hooks P S D MD B I) (budget : Nat) :

                      Preserve remaining portable source handlers and their fallback ordering.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For