)]}'
{
  "commit": "993b8a3b60a8406448856110b1351a7098c4b704",
  "tree": "244420b87851a0c4e930845816e39102cf558305",
  "parents": [
    "b975d9d903f7a60510393d438a086294ab086dea"
  ],
  "author": {
    "name": "Eylon Krause",
    "email": "eylon1909@gmail.com",
    "time": "Thu Jul 09 13:48:02 2026 +0300"
  },
  "committer": {
    "name": "Eylon Krause",
    "email": "eylon1909@gmail.com",
    "time": "Thu Sep 03 10:42:59 2026 +0300"
  },
  "message": "[preprocessor] Fix crash/hang on truncated callable macro invocation\n\nGenerateBypassWhiteSpaces dereferences the stream iterator (**iterator) with no\nend guard, relying on every stream ending in a kept EOF token. The streams\nre-lexed for macro expansion in ExpandText, ExpandMacro, HandleInclude and the\nstandalone tool strip the EOF (loop stops on !isEOF()), so a callable macro\ninvocation truncated at end-of-stream (e.g. `define A(x) hello `A followed by\n`A(1)) makes the streamer return the view\u0027s end() iterator and the deref reads\npast the end -\u003e SIGSEGV. An included file ending in a callable macro crashes the\nsame way; a \u0027(\u0027 with no \u0027)\u0027 spins forever.\n\nRestore the kept-EOF sentinel on each re-lexed stream so the whitespace-skip\nloop stops at EOF and callers return a diagnostic instead of dereferencing past\nthe end: append the EOF sentinel in all four stream builders; break on it in the\ntwo token-pulling loops so it is not forwarded; skip it when splicing an included\nchild stream into the parent; and break on EOF in the argument-scanning loop\n(the one caller that did not handle a mid-scan EOF, which otherwise hangs on a\n\u0027(\u0027 without \u0027)\u0027). Also record the \"callable macro without ()\" error in\npreprocess_data_.errors instead of silently swallowing it (requires making\nConsumeAndParseMacroCall non-static).\n\nAdds TruncatedCallableMacroDoesNotCrash. Existing preprocessor and analyzer test\nsuites pass. Unbounded macro self-recursion is a separate pre-existing bug and\nis not addressed here.\n\nSigned-off-by: Eylon Krause \u003ceylon1909@gmail.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2f77111428389da7f2e3b12288e0d47056162ffa",
      "old_mode": 33188,
      "old_path": "verible/verilog/preprocessor/verilog-preprocess.cc",
      "new_id": "1d847fb9993e84b22d62298ad30132e65b3302cb",
      "new_mode": 33188,
      "new_path": "verible/verilog/preprocessor/verilog-preprocess.cc"
    },
    {
      "type": "modify",
      "old_id": "2d134ae66222f20e693ee08b8646679fd353a4aa",
      "old_mode": 33188,
      "old_path": "verible/verilog/preprocessor/verilog-preprocess.h",
      "new_id": "0d932f0510b599d10da9219bfa5713564fc6e12b",
      "new_mode": 33188,
      "new_path": "verible/verilog/preprocessor/verilog-preprocess.h"
    },
    {
      "type": "modify",
      "old_id": "ae335679a42323ebfcb9e9406b32c6daa3f319c0",
      "old_mode": 33188,
      "old_path": "verible/verilog/preprocessor/verilog-preprocess_test.cc",
      "new_id": "a8e41d9b855550bca5a42611a16c054e4daf9bab",
      "new_mode": 33188,
      "new_path": "verible/verilog/preprocessor/verilog-preprocess_test.cc"
    },
    {
      "type": "modify",
      "old_id": "c23fdf7fffb6a4e02c281f97d035db2191f5d5df",
      "old_mode": 33188,
      "old_path": "verible/verilog/tools/preprocessor/verilog-preprocessor.cc",
      "new_id": "af781f39c9dfbe607e9f9a960815eaa268179e15",
      "new_mode": 33188,
      "new_path": "verible/verilog/tools/preprocessor/verilog-preprocessor.cc"
    }
  ]
}
