From fa4afe020d48ce872f6d7dfde946314c7b2a30c8 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 21 Feb 2014 23:40:22 +0100 Subject: Handle ImplicitCastExpr w/ invalid loc from Objective C code Change-Id: I82cb8aa53ea5fd86d6ff46af876dd3f55e1123d1 --- compilerplugins/clang/plugin.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compilerplugins/clang') diff --git a/compilerplugins/clang/plugin.hxx b/compilerplugins/clang/plugin.hxx index 796ebef74a11..b70fd7831db7 100644 --- a/compilerplugins/clang/plugin.hxx +++ b/compilerplugins/clang/plugin.hxx @@ -180,7 +180,9 @@ bool Plugin::ignoreLocation( const Decl* decl ) inline bool Plugin::ignoreLocation( const Stmt* stmt ) { - return ignoreLocation( stmt->getLocStart()); + // Invalid location can happen at least for ImplicitCastExpr of + // ImplicitParam 'self' in Objective C method declarations: + return stmt->getLocStart().isValid() && ignoreLocation( stmt->getLocStart()); } template< typename T > -- cgit