summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-11-22 11:37:11 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-11-22 11:37:11 +0000
commita673e8352a64665598e6cabd37ba9f51fd9841b6 (patch)
tree665e47c49382964469871edae45f6376fbb90d27 /lib
parentfdb00a9bdb908859cf491c2cef805f5fbee3bfc9 (diff)
downloadllvm-a673e8352a64665598e6cabd37ba9f51fd9841b6.tar.gz
llvm-a673e8352a64665598e6cabd37ba9f51fd9841b6.tar.bz2
llvm-a673e8352a64665598e6cabd37ba9f51fd9841b6.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145059 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/MemoryBuffer.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
index cc3f6a8a48..580338117b 100644
--- a/lib/Support/MemoryBuffer.cpp
+++ b/lib/Support/MemoryBuffer.cpp
@@ -330,13 +330,8 @@ error_code MemoryBuffer::getOpenFile(int FD, const char *Filename,
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;
}