)]}'
{
  "commit": "4f9a7d09f4760ac9c5745e8bb829366d29ff9687",
  "tree": "5b2e171ccacef7f743266787ca1ec77a19173fad",
  "parents": [
    "e92c0d2b2b2549ee3aef69d95fca8ab5f0f8d5d2"
  ],
  "author": {
    "name": "Qiongsi Wu",
    "email": "qiongsiwu@gmail.com",
    "time": "Fri May 15 13:19:54 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri May 15 13:19:54 2026 -0700"
  },
  "message": "[clang][DependencyScanning] Preserve Necessary Preprocessor Callbacks during By-name Lookup (#197731)\n\nThe by-name lookup logic uses new dependency collector callbacks per\nlookup. The algorithm used to wipe out all callbacks for each query.\nThis turned out to be perilous. We have two raw pointers in the\npreprocessor that point to the callbacks, and removing all callbacks per\nquery can lead to use-after-free situations through these dangling\npointers. Resetting the dangling pointers to null does not really work\neither, since there may be dependencies between the callbacks and other\ndata structures. An example of this is the `PreprocessingRecord *Record`\ncallback and the `GlobalPreprocessedEntityMap` in ASTReader. Hence, to\nfix the use-after-free issue, we preserve the callbacks that the\npreprocessor may hold a raw pointer to.\n\nThis is not intended to indicate how we want to handle this in the long\nrun. We should avoid removing PP callbacks and reset their states across\nby-name lookups.\n\nrdar://175362366",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "51c6a31e143b8f7512192046e984e0f752a652f8",
      "old_mode": 33188,
      "old_path": "clang/include/clang/Lex/PPCallbacks.h",
      "new_id": "2f62fa8d52b1ade1bd2ab0e34a584d90f053091a",
      "new_mode": 33188,
      "new_path": "clang/include/clang/Lex/PPCallbacks.h"
    },
    {
      "type": "modify",
      "old_id": "eb9e46e7cee898bdcda4d3257d32f1756c67db7c",
      "old_mode": 33188,
      "old_path": "clang/include/clang/Lex/Preprocessor.h",
      "new_id": "6c8d3ace10309f721191ba51ac33464279f7fc4a",
      "new_mode": 33188,
      "new_path": "clang/include/clang/Lex/Preprocessor.h"
    },
    {
      "type": "modify",
      "old_id": "d190f79a7178839992a180cd1d425bbeb6c62736",
      "old_mode": 33188,
      "old_path": "clang/lib/Lex/Preprocessor.cpp",
      "new_id": "1e21b4a94cea3c2ec57a65b3d90c59c4171a0426",
      "new_mode": 33188,
      "new_path": "clang/lib/Lex/Preprocessor.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "97cb44463a958ed9f7f33fd607c1cefdd114a0c5",
      "new_mode": 33188,
      "new_path": "clang/test/ClangScanDeps/modules-by-name-detailed-preprocessing-record.c"
    }
  ]
}
