r181329 - Prevent crashes from hasCanonicalType matcher
Edwin Vane
edwin.vane at intel.com
Tue May 7 08:53:23 PDT 2013
Author: revane
Date: Tue May 7 10:53:23 2013
New Revision: 181329
URL: http://llvm.org/viewvc/llvm-project?rev=181329&view=rev
Log:
Prevent crashes from hasCanonicalType matcher
Adding an QualType::isNull() check.
Modified:
cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h?rev=181329&r1=181328&r2=181329&view=diff
==============================================================================
--- cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h (original)
+++ cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h Tue May 7 10:53:23 2013
@@ -1841,6 +1841,8 @@ AST_MATCHER_P(QualType, references, inte
/// varDecl(hasType(qualType(hasCanonicalType(referenceType())))))) does.
AST_MATCHER_P(QualType, hasCanonicalType, internal::Matcher<QualType>,
InnerMatcher) {
+ if (Node.isNull())
+ return false;
return InnerMatcher.matches(Node.getCanonicalType(), Finder, Builder);
}
More information about the cfe-commits
mailing list