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:
d966bf8
)
[clangd] Fix null check in FindTarget.
author
Sam McCall
<sam.mccall@gmail.com>
Wed, 29 Jan 2020 01:01:42 +0000
(
02:01
+0100)
committer
Sam McCall
<sam.mccall@gmail.com>
Wed, 29 Jan 2020 01:01:42 +0000
(
02:01
+0100)
I've hit this stack trace a few times but don't have a good reproducer.
The code is unsafe by inspection, though.
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
2392586
..
13e4819
100644
(file)
--- a/
clang-tools-extra/clangd/FindTarget.cpp
+++ b/
clang-tools-extra/clangd/FindTarget.cpp
@@
-231,7
+231,7
@@
public:
}
void add(const Decl *Dcl, RelSet Flags) {
- const NamedDecl *D = llvm::dyn_cast<NamedDecl>(Dcl);
+ const NamedDecl *D = llvm::dyn_cast
_or_null
<NamedDecl>(Dcl);
if (!D)
return;
debug(*D, Flags);