diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2015-02-19 20:12:20 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2015-02-19 20:12:20 +0000 |
commit | bd0b651bd249ab766f9c17cf4a9f5ef268f53632 (patch) | |
tree | 3aa21db58320d852de48f1eb76db2cfb32406da6 /clang/lib/Frontend/FrontendAction.cpp | |
parent | dfedfeb298ae491ff6f2f39ab33c01739177d365 (diff) | |
download | bcm5719-llvm-bd0b651bd249ab766f9c17cf4a9f5ef268f53632.tar.gz bcm5719-llvm-bd0b651bd249ab766f9c17cf4a9f5ef268f53632.zip |
[PCH/Modules] Check that the specific module cache path the PCH was built with, is the same as
the one in the current compiler invocation. If they differ reject the PCH.
This protects against the badness occurring from getting modules loaded from different module caches (see crashes).
rdar://19889860
llvm-svn: 229909
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 0bb5d87407b..75670d9a202 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -262,6 +262,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, FileManager &FileMgr = CI.getFileManager(); PreprocessorOptions &PPOpts = CI.getPreprocessorOpts(); StringRef PCHInclude = PPOpts.ImplicitPCHInclude; + std::string SpecificModuleCachePath = CI.getSpecificModuleCachePath(); if (const DirectoryEntry *PCHDir = FileMgr.getDirectory(PCHInclude)) { std::error_code EC; SmallString<128> DirNative; @@ -273,7 +274,8 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, if (ASTReader::isAcceptableASTFile(Dir->path(), FileMgr, CI.getLangOpts(), CI.getTargetOpts(), - CI.getPreprocessorOpts())) { + CI.getPreprocessorOpts(), + SpecificModuleCachePath)) { PPOpts.ImplicitPCHInclude = Dir->path(); Found = true; break; |