prevent crash when rewriting source

Change-Id: I97519c2fb08efa2c694c9fb91a4cc402a6347c2c
This commit is contained in:
Luboš Luňák
2013-08-14 19:00:21 +02:00
parent 4f60eb885a
commit 21c795488c

View File

@@ -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,