From 21c795488c67a8e35354ca7175445a770600159b Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 14 Aug 2013 19:00:21 +0200 Subject: prevent crash when rewriting source Change-Id: I97519c2fb08efa2c694c9fb91a4cc402a6347c2c --- compilerplugins/clang/pluginhandler.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compilerplugins') diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index e36a82140be3..5f4928eb9ad8 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -157,6 +157,8 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context ) ++it ) { const FileEntry* e = context.getSourceManager().getFileEntryForID( it->first ); + if( e == NULL ) + continue; // Failed modification because of a macro expansion? /* Check where the file actually is, and warn about cases where modification most probably doesn't matter (generated files in workdir). The order here is important, as OUTDIR and WORKDIR are often in SRCDIR/BUILDDIR, -- cgit