summaryrefslogtreecommitdiff
path: root/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
commit1b45cd564b15f4e53ebd53f0deaefc989240be51 (patch)
treed838321c2284a9b9b88d635ca213ae441843d98c /lib/AST/StmtProfile.cpp
parent95df7b211f9c2409d596972c3ff2babf58e2f52a (diff)
downloadclang-1b45cd564b15f4e53ebd53f0deaefc989240be51.tar.gz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/StmtProfile.cpp')
-rw-r--r--lib/AST/StmtProfile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp
index 1ac2a5bf5e..5f3a50b155 100644
--- a/lib/AST/StmtProfile.cpp
+++ b/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());