[all-commits] [llvm/llvm-project] 4061d9: [clangd] Fix crash-bug in preamble indexing when u...
Adam Czachorowski via All-commits
all-commits at lists.llvm.org
Mon Aug 10 09:45:26 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 4061d9e42cff621462931ac7df9666806c77a237
https://github.com/llvm/llvm-project/commit/4061d9e42cff621462931ac7df9666806c77a237
Author: Adam Czachorowski <adamcz at google.com>
Date: 2020-08-10 (Mon, 10 Aug 2020)
Changed paths:
M clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
M clang-tools-extra/clangd/unittests/TestFS.h
M clang-tools-extra/clangd/unittests/TestTU.cpp
M clang-tools-extra/clangd/unittests/TestTU.h
M clang/lib/Index/IndexingAction.cpp
Log Message:
-----------
[clangd] Fix crash-bug in preamble indexing when using modules.
Summary:
When preamble contains #undef, indexing code finds the matching #define
and uses that during indexing. However, it would only look for local
definitions. If the macro was defined in a module, MacroInfo
would be nullptr and clangd would crash.
This change makes clangd ignore any #undef without a matching #define
inside the same TU.
The indexing of macros happens for preamble only, so then #undef must be
in the preamble, which is why we need two .h files in a test.
Note that clangd is currently not ready for module support, but this
brings us one step closer.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80525
More information about the All-commits
mailing list