[llvm] r208143 - [Support/MemoryBuffer] Remove the assertion that the file size did not shrink.

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue May 6 16:30:56 PDT 2014


Author: akirtzidis
Date: Tue May  6 18:30:56 2014
New Revision: 208143

URL: http://llvm.org/viewvc/llvm-project?rev=208143&view=rev
Log:
[Support/MemoryBuffer] Remove the assertion that the file size did not shrink.

This can happen in practice with the user changing files and we can recover from it.

Modified:
    llvm/trunk/lib/Support/MemoryBuffer.cpp

Modified: llvm/trunk/lib/Support/MemoryBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/MemoryBuffer.cpp?rev=208143&r1=208142&r2=208143&view=diff
==============================================================================
--- llvm/trunk/lib/Support/MemoryBuffer.cpp (original)
+++ llvm/trunk/lib/Support/MemoryBuffer.cpp Tue May  6 18:30:56 2014
@@ -426,9 +426,6 @@ static error_code getOpenFileImpl(int FD
       return error_code(errno, posix_category());
     }
     if (NumRead == 0) {
-      assert(IsVolatileSize &&
-             "We got inaccurate FileSize value or fstat reported an invalid "
-             "file size.");
       memset(BufPtr, 0, BytesLeft); // zero-initialize rest of the buffer.
       break;
     }





More information about the llvm-commits mailing list