[clangd] Fix a nullptr-dereference crash in computeIncludeCleanerFindings.
authorHaojian Wu <hokein.wu@gmail.com>
Thu, 6 Apr 2023 08:11:46 +0000 (10:11 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Thu, 13 Apr 2023 10:17:39 +0000 (12:17 +0200)
commit2524000187fc56a3f818a6562199037a90108eda
tree9beaabc5e2ef9d17393f48290fcc8d09dc3364e2
parented3cbfcd1e4d7cd1643445552648631fb92fedce
[clangd] Fix a nullptr-dereference crash in computeIncludeCleanerFindings.

Be more robust, we shuold not crash  when we cannot find the corresponding token from the
tokenbuffer.

Differential Revision: https://reviews.llvm.org/D147686
clang-tools-extra/clangd/IncludeCleaner.cpp
clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp