forked from OSchip/llvm-project
Don't crash in InitializePreprocessor() when there is no valid PTHManager. Fixes <rdar://problem/8098441>.
llvm-svn: 107061
This commit is contained in:
parent
ee6e29aa72
commit
ea78375ed4
|
@ -84,7 +84,8 @@ static void AddImplicitIncludePTH(MacroBuilder &Builder, Preprocessor &PP,
|
|||
llvm::StringRef ImplicitIncludePTH) {
|
||||
PTHManager *P = PP.getPTHManager();
|
||||
assert(P && "No PTHManager.");
|
||||
const char *OriginalFile = P->getOriginalSourceFile();
|
||||
// Null check 'P' in the corner case where it couldn't be created.
|
||||
const char *OriginalFile = P ? P->getOriginalSourceFile() : 0;
|
||||
|
||||
if (!OriginalFile) {
|
||||
PP.getDiagnostics().Report(diag::err_fe_pth_file_has_no_source_header)
|
||||
|
|
Loading…
Reference in New Issue