Documentation

Miri.Interpreter.OsStrings

Pinned shims/os_str.rs. Host OsStr encodings remain explicit operational leaves; they are not replaced with Lean UTF-8 strings. Allocation size follows the source encoded-byte length even for UTF-16 output. Path conversion itself is implemented on exact code units, preserving invalid non-Unicode paths.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Miri.Interpreter.OsStrings.windowsToUnix {A : Type u_1} [BEq A] (ascii : UInt8 → A) (path : List A) :

      Generic code units implement the same source routine for u8 and u16.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def Miri.Interpreter.OsStrings.unixToWindows {A : Type u_1} [BEq A] (ascii : UInt8 → A) (path : List A) :
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          structure Miri.Interpreter.OsStrings.Hooks (P S Os Kind : Type) :
          Instances For
            def Miri.Interpreter.OsStrings.bytesToOsStr {P S Os Kind : Type} (h : Hooks P S Os Kind) (bytes : ByteArray) :
            Equations
            Instances For

              Unix OsString::into_string: consume the exact encoded bytes and return the string only when they form valid UTF-8. This is distinct from lossy display conversion and is the operation used by Miri's localtime_r for guest TZ.

              Equations
              Instances For
                def Miri.Interpreter.OsStrings.unixIntoStringOf {Os : Type} (encodedBytes : Os → ByteArray) (value : Os) :
                Equations
                Instances For
                  def Miri.Interpreter.OsStrings.readOsString {P S Os Kind : Type} (h : Hooks P S Os Kind) (pointer : Memory.Pointer (Option P)) :
                  M S Os
                  Equations
                  Instances For
                    def Miri.Interpreter.OsStrings.readOsWideString {P S Os Kind : Type} (h : Hooks P S Os Kind) (pointer : Memory.Pointer (Option P)) :
                    M S Os
                    Equations
                    Instances For
                      def Miri.Interpreter.OsStrings.writeOsString {P S Os Kind : Type} (h : Hooks P S Os Kind) (value : Os) (pointer : Memory.Pointer (Option P)) (capacity : UInt64) :
                      Equations
                      Instances For
                        def Miri.Interpreter.OsStrings.writeOsWideString {P S Os Kind : Type} (h : Hooks P S Os Kind) (value : Os) (pointer : Memory.Pointer (Option P)) (capacity : UInt64) (truncate : Bool := false) :

                        Return the original failed/full length result even after successfully writing the truncated prefix, exactly as the source helper does.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Miri.Interpreter.OsStrings.allocOsString {P S Os Kind : Type} (h : Hooks P S Os Kind) (value : Os) (kind : Kind) (wide : Bool := false) :

                          Source uses encoded OsStr length for both arrays, before conversion to UTF-16. Its unwrap/assert failure occurs after the actual allocation effects.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def Miri.Interpreter.OsStrings.convertPath {P S Os Kind : Type} (h : Hooks P S Os Kind) (value : Os) (direction : Direction) :
                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Miri.Interpreter.OsStrings.readPath {P S Os Kind : Type} (h : Hooks P S Os Kind) (pointer : Memory.Pointer (Option P)) (wide : Bool := false) :
                              M S Os
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Miri.Interpreter.OsStrings.writePath {P S Os Kind : Type} (h : Hooks P S Os Kind) (path : Os) (pointer : Memory.Pointer (Option P)) (capacity : UInt64) (wide truncate : Bool := false) :
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Miri.Interpreter.OsStrings.allocPath {P S Os Kind : Type} (h : Hooks P S Os Kind) (path : Os) (kind : Kind) (wide : Bool := false) :
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For