Fix a use-after-free bug I recently introduced in lookupModuleFile
llvm-svn: 207932
This commit is contained in:
@@ -390,11 +390,10 @@ bool ModuleManager::lookupModuleFile(StringRef FileName,
|
||||
}
|
||||
|
||||
if ((ExpectedSize && ExpectedSize != File->getSize()) ||
|
||||
(ExpectedModTime && ExpectedModTime != File->getModificationTime())) {
|
||||
FileMgr.invalidateCache(File);
|
||||
File = nullptr;
|
||||
(ExpectedModTime && ExpectedModTime != File->getModificationTime()))
|
||||
// Do not destroy File, as it may be referenced. If we need to rebuild it,
|
||||
// it will be destroyed by removeModules.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user