Skip to content
Snippets Groups Projects
Commit 54eeac9c authored by Edwin Vane's avatar Edwin Vane
Browse files

Prevent crashes from hasCanonicalType matcher

Adding an QualType::isNull() check.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181329 91177308-0d34-0410-b5e6-96231b3b80d8
parent d71ec16f
No related branches found
No related tags found
No related merge requests found
...@@ -1841,6 +1841,8 @@ AST_MATCHER_P(QualType, references, internal::Matcher<QualType>, ...@@ -1841,6 +1841,8 @@ AST_MATCHER_P(QualType, references, internal::Matcher<QualType>,
/// varDecl(hasType(qualType(hasCanonicalType(referenceType())))))) does. /// varDecl(hasType(qualType(hasCanonicalType(referenceType())))))) does.
AST_MATCHER_P(QualType, hasCanonicalType, internal::Matcher<QualType>, AST_MATCHER_P(QualType, hasCanonicalType, internal::Matcher<QualType>,
InnerMatcher) { InnerMatcher) {
if (Node.isNull())
return false;
return InnerMatcher.matches(Node.getCanonicalType(), Finder, Builder); return InnerMatcher.matches(Node.getCanonicalType(), Finder, Builder);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment