[cfe-commits] r104856 - /cfe/trunk/lib/Frontend/CompilerInstance.cpp
Dan Gohman
gohman at apple.com
Thu May 27 10:33:40 PDT 2010
Author: djg
Date: Thu May 27 12:33:40 2010
New Revision: 104856
URL: http://llvm.org/viewvc/llvm-project?rev=104856&view=rev
Log:
MemoryBuffer::getSTDIN may return a null pointer if an error occurs.
Modified:
cfe/trunk/lib/Frontend/CompilerInstance.cpp
Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=104856&r1=104855&r2=104856&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Thu May 27 12:33:40 2010
@@ -442,7 +442,7 @@
}
} 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;
More information about the cfe-commits
mailing list