summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-08-28 22:18:42 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-08-28 22:18:42 +0000
commitd07864a37ba2d03c440b210f1ab92aa81cd83399 (patch)
tree9a53383ac8efb74fcd42c1cfbefb09dd6e2e80e6 /clang/lib
parent281961a8211d362b44000d2747851f4a67d508c3 (diff)
downloadbcm5719-llvm-d07864a37ba2d03c440b210f1ab92aa81cd83399.tar.gz
bcm5719-llvm-d07864a37ba2d03c440b210f1ab92aa81cd83399.zip
Don't create a null reference to NestedNameSpecifier.
This bug was reported by UBSan. llvm-svn: 216691
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/ASTMatchers/ASTMatchFinder.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/ASTMatchers/ASTMatchFinder.cpp b/clang/lib/ASTMatchers/ASTMatchFinder.cpp
index 050630fd4bd..6c5bc3c3727 100644
--- a/clang/lib/ASTMatchers/ASTMatchFinder.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchFinder.cpp
@@ -731,7 +731,8 @@ bool MatchASTVisitor::TraverseNestedNameSpecifierLoc(
match(NNS);
// We only match the nested name specifier here (as opposed to traversing it)
// because the traversal is already done in the parallel "Loc"-hierarchy.
- match(*NNS.getNestedNameSpecifier());
+ if (NNS.hasQualifier())
+ match(*NNS.getNestedNameSpecifier());
return
RecursiveASTVisitor<MatchASTVisitor>::TraverseNestedNameSpecifierLoc(NNS);
}
OpenPOWER on IntegriCloud