forked from OSchip/llvm-project
MemoryBuffer::getSTDIN may return a null pointer if an error occurs.
llvm-svn: 104856
This commit is contained in:
parent
c36b1f35f0
commit
cab4933f95
|
@ -442,7 +442,7 @@ bool CompilerInstance::InitializeSourceManager(llvm::StringRef InputFile,
|
|||
}
|
||||
} else {
|
||||
llvm::MemoryBuffer *SB = llvm::MemoryBuffer::getSTDIN();
|
||||
SourceMgr.createMainFileIDForMemBuffer(SB);
|
||||
if (SB) SourceMgr.createMainFileIDForMemBuffer(SB);
|
||||
if (SourceMgr.getMainFileID().isInvalid()) {
|
||||
Diags.Report(diag::err_fe_error_reading_stdin);
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue