[llvm-branch-commits] [cfe-branch] r105027 - /cfe/branches/Apple/whitney/lib/Frontend/CompilerInstance.cpp

Daniel Dunbar daniel at zuster.org
Fri May 28 16:06:14 PDT 2010


Author: ddunbar
Date: Fri May 28 18:06:14 2010
New Revision: 105027

URL: http://llvm.org/viewvc/llvm-project?rev=105027&view=rev
Log:
Merge r104856:
--
Author: Dan Gohman <gohman at apple.com>
Date:   Thu May 27 17:33:40 2010 +0000

    MemoryBuffer::getSTDIN may return a null pointer if an error occurs.

Modified:
    cfe/branches/Apple/whitney/lib/Frontend/CompilerInstance.cpp

Modified: cfe/branches/Apple/whitney/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Frontend/CompilerInstance.cpp?rev=105027&r1=105026&r2=105027&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Frontend/CompilerInstance.cpp Fri May 28 18:06:14 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 llvm-branch-commits mailing list