)]}'
{
  "commit": "33570f263222fe8aa4e071f4a30b1b69bfc0f4e3",
  "tree": "b7b7441788542dd22d996a824710b8ff1687e48c",
  "parents": [
    "ff38677829d4c2756700194d4e252ad7290c5e98"
  ],
  "author": {
    "name": "Matthias Görgens",
    "email": "matthias.goergens@gmail.com",
    "time": "Fri Oct 30 02:48:02 2026 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Oct 29 11:48:02 2026 -0700"
  },
  "message": "fix: support strings with NUL bytes (#15)\n\n* fix: support strings with NUL bytes\n\nLean strings can contain NUL (U+0000): the literal \"a\\x00b\" is a\nthree-character string, and the .olean stores its bytes followed by the\nusual NUL terminator.  The STRING opcode writes a string\u0027s bytes up to\nand including the first NUL, so it cannot represent such a string, and\nthe compressor asserted that the first NUL was the terminator.  Packing\nany module with such a literal panicked at that assertion, which makes\n`lake build -o` fail for the module.\n\nA new opcode SIZED_STRING (0xb0, free in normal mode since pack_ctor\nnever yields a zero low nibble) is followed by the byte length, without\nthe terminator, and then the bytes.  The compressor emits it only for\nstrings with a NUL before the terminator and keeps STRING for all\nothers, so archives of other modules are unchanged.  The decompressor\ncounts the characters for the length field as it does for STRING.\n\nA leantar without this change cannot unpack an archive containing\nSIZED_STRING.  Master panics with \"unknown opcode 0xb0\".  Releases up to\n0.1.21 decode 0xb0 as a constructor without fields and lose their place\nin the stream: for an archive of a module with the literal above, 0.1.20\nand 0.1.21 panic further on, and in principle such a misreading could\nalso end in a wrong .olean.  No older leantar could have written such an\narchive.\n\nThe approach follows #9 by ericrbg-harmonic, which used 0xa0, since\ntaken by SCALAR_ARRAY.\n\n* read SIZED_STRING payload with read_exact like MPZ\n\n---------\n\nCo-authored-by: Matthias Görgens \u003cmatthias@metisr.ai\u003e\nCo-authored-by: Mario Carneiro \u003cdi.gama@gmail.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8a71c91b1691247fc84111fd05f39c6553fd6775",
      "old_mode": 33188,
      "old_path": "src/lgz.rs",
      "new_id": "cd4aeced3d22b2f8bb34754346252d05e96cbc91",
      "new_mode": 33188,
      "new_path": "src/lgz.rs"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a6847ce1412377cc2255dc5e511ccc5b16e63ce4",
      "new_mode": 33188,
      "new_path": "tests/string_nul.rs"
    }
  ]
}
