summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtProfile.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2017-03-04 02:42:41 +0000
committerRichard Trieu <rtrieu@google.com>2017-03-04 02:42:41 +0000
commita5f4ade268d0e5466d01c8dcb9f71fb8f3454047 (patch)
treec5f39a4f06c4acbe8b50abbc8a7f3308936bb755 /clang/lib/AST/StmtProfile.cpp
parentd532ddcce9076f099e30193de663ea326d6bd1c4 (diff)
downloadbcm5719-llvm-a5f4ade268d0e5466d01c8dcb9f71fb8f3454047.tar.gz
bcm5719-llvm-a5f4ade268d0e5466d01c8dcb9f71fb8f3454047.zip
Handle null QualType better in Stmt::Profile
If the QualType is null, calling ASTContext::getCanonicalType on it will lead to an assert. This was found while testing a new use for Stmt::Profile, so there is no test case for this. llvm-svn: 296956
Diffstat (limited to 'clang/lib/AST/StmtProfile.cpp')
-rw-r--r--clang/lib/AST/StmtProfile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index 1ac2a5bf5e1..5f3a50b155b 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -128,7 +128,7 @@ namespace {
}
void VisitType(QualType T) override {
- if (Canonical)
+ if (Canonical && !T.isNull())
T = Context.getCanonicalType(T);
ID.AddPointer(T.getAsOpaquePtr());
OpenPOWER on IntegriCloud