diff options
author | Richard Trieu <rtrieu@google.com> | 2017-03-04 02:42:41 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2017-03-04 02:42:41 +0000 |
commit | a5f4ade268d0e5466d01c8dcb9f71fb8f3454047 (patch) | |
tree | c5f39a4f06c4acbe8b50abbc8a7f3308936bb755 /clang/lib/AST/StmtProfile.cpp | |
parent | d532ddcce9076f099e30193de663ea326d6bd1c4 (diff) | |
download | bcm5719-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.cpp | 2 |
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()); |