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
This commit is contained in:
Richard Trieu 2017-03-04 02:42:41 +00:00
parent d532ddcce9
commit a5f4ade268
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ namespace {
}
void VisitType(QualType T) override {
if (Canonical)
if (Canonical && !T.isNull())
T = Context.getCanonicalType(T);
ID.AddPointer(T.getAsOpaquePtr());