summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-08-22 01:16:44 +0000
committerRichard Trieu <rtrieu@google.com>2014-08-22 01:16:44 +0000
commitf98341ea4fdce4d41881bd40a31be038d574bc1c (patch)
treeaae83e3dba7928ec2a1053668c954766fa50399d /clang/lib/Sema/SemaDecl.cpp
parent5711df44b8bdc723934f49f97ea53d1d5e2e16a9 (diff)
downloadbcm5719-llvm-f98341ea4fdce4d41881bd40a31be038d574bc1c.tar.gz
bcm5719-llvm-f98341ea4fdce4d41881bd40a31be038d574bc1c.zip
Fix PR20705, crash on invalid.
dyn_cast -> dyn_cast_or_null to handle a null pointer. llvm-svn: 216254
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index c8c381518b1..0244d4c4a30 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -9300,7 +9300,7 @@ Sema::FinalizeDeclaration(Decl *ThisDecl) {
// Static locals inherit dll attributes from their function.
if (VD->isStaticLocal()) {
if (FunctionDecl *FD =
- dyn_cast<FunctionDecl>(VD->getParentFunctionOrMethod())) {
+ dyn_cast_or_null<FunctionDecl>(VD->getParentFunctionOrMethod())) {
if (Attr *A = getDLLAttr(FD)) {
auto *NewAttr = cast<InheritableAttr>(A->clone(getASTContext()));
NewAttr->setInherited(true);
OpenPOWER on IntegriCloud