projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
76c0577
)
[clangd] Fix null check after D82739.
author
Haojian Wu
<hokein.wu@gmail.com>
Tue, 21 Jul 2020 10:11:52 +0000
(12:11 +0200)
committer
Haojian Wu
<hokein.wu@gmail.com>
Tue, 21 Jul 2020 10:15:17 +0000
(12:15 +0200)
I hit the null-deference crash when opening ASTReaderDecl.cpp.
The BaseType can be a nullptr,
clang-tools-extra/clangd/FindTarget.cpp
patch
|
blob
|
history
diff --git
a/clang-tools-extra/clangd/FindTarget.cpp
b/clang-tools-extra/clangd/FindTarget.cpp
index
bc4002c
..
c6022b2
100644
(file)
--- a/
clang-tools-extra/clangd/FindTarget.cpp
+++ b/
clang-tools-extra/clangd/FindTarget.cpp
@@
-175,6
+175,8
@@
std::vector<const NamedDecl *> resolveDependentExprToDecls(const Expr *E) {
if (ME->isArrow()) {
BaseType = getPointeeType(BaseType);
}
+ if (!BaseType)
+ return {};
if (const auto *BT = BaseType->getAs<BuiltinType>()) {
// If BaseType is the type of a dependent expression, it's just
// represented as BultinType::Dependent which gives us no information. We