[llvm-commits] [llvm] r145059 - /llvm/trunk/lib/Support/MemoryBuffer.cpp
Benjamin Kramer
benny.kra at googlemail.com
Tue Nov 22 03:37:11 PST 2011
Author: d0k
Date: Tue Nov 22 05:37:11 2011
New Revision: 145059
URL: http://llvm.org/viewvc/llvm-project?rev=145059&view=rev
Log:
Turn error recovery into an assert.
This was put in because in a certain version of DragonFlyBSD stat(2) lied about the
size of some files. This was fixed a long time ago so we can remove the workaround.
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=145059&r1=145058&r2=145059&view=diff
==============================================================================
--- llvm/trunk/lib/Support/MemoryBuffer.cpp (original)
+++ llvm/trunk/lib/Support/MemoryBuffer.cpp Tue Nov 22 05:37:11 2011
@@ -330,13 +330,8 @@
continue;
// Error while reading.
return error_code(errno, posix_category());
- } else if (NumRead == 0) {
- // We hit EOF early, truncate and terminate buffer.
- Buf->BufferEnd = BufPtr;
- *BufPtr = 0;
- result.swap(SB);
- return success;
}
+ assert(NumRead != 0 && "fstat reported an invalid file size.");
BytesLeft -= NumRead;
BufPtr += NumRead;
}
More information about the llvm-commits
mailing list