summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
authorShuai Wang <shuaiwang@google.com>2018-09-19 18:00:55 +0000
committerShuai Wang <shuaiwang@google.com>2018-09-19 18:00:55 +0000
commit86e5cb0e0bc938c9cf44d91eeffdce31ab5cb3ee (patch)
tree3680dc59a119ff4c387bcb3ee1cfdff3f52827dc /clang/lib/Analysis
parentc33b2e6d0f84125c77fad2fe715f9c4a35ad19de (diff)
downloadbcm5719-llvm-86e5cb0e0bc938c9cf44d91eeffdce31ab5cb3ee.tar.gz
bcm5719-llvm-86e5cb0e0bc938c9cf44d91eeffdce31ab5cb3ee.zip
[analyzer] Fix nullptr access when processing instantiated function in ExprMutationAnalyzer.
llvm-svn: 342562
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/ExprMutationAnalyzer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Analysis/ExprMutationAnalyzer.cpp b/clang/lib/Analysis/ExprMutationAnalyzer.cpp
index db8c259a52a..8414cb5c726 100644
--- a/clang/lib/Analysis/ExprMutationAnalyzer.cpp
+++ b/clang/lib/Analysis/ExprMutationAnalyzer.cpp
@@ -379,7 +379,7 @@ const Stmt *ExprMutationAnalyzer::findFunctionArgMutation(const Expr *Exp) {
for (const auto &Nodes : Matches) {
const auto *Exp = Nodes.getNodeAs<Expr>(NodeID<Expr>::value);
const auto *Func = Nodes.getNodeAs<FunctionDecl>("func");
- if (!Func->getBody())
+ if (!Func->getBody() || !Func->getPrimaryTemplate())
return Exp;
const auto *Parm = Nodes.getNodeAs<ParmVarDecl>("parm");
OpenPOWER on IntegriCloud