summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-08-14 19:00:21 +0200
committerLuboš Luňák <l.lunak@suse.cz>2013-08-21 15:08:16 +0200
commit21c795488c67a8e35354ca7175445a770600159b (patch)
tree5c686fce2e8d6b938be99b91fbdbc37635d93b1d
parent4f60eb885a5480832d1148205a08eafc6c50aa39 (diff)
prevent crash when rewriting source
Change-Id: I97519c2fb08efa2c694c9fb91a4cc402a6347c2c
-rw-r--r--compilerplugins/clang/pluginhandler.cxx2
1 files changed, 2 insertions, 0 deletions
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,