summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitf22623b78b2fa5d7aa0d325913f399a8f82aaf21 (patch)
tree83f617bb5d31729a4f2e099d888902aeb1a3692a /llvm/lib
parent4c910b1475a43076530c89835f9d7c5b44c21489 (diff)
downloadbcm5719-llvm-f22623b78b2fa5d7aa0d325913f399a8f82aaf21.tar.gz
bcm5719-llvm-f22623b78b2fa5d7aa0d325913f399a8f82aaf21.zip
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. llvm-svn: 145059
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/MemoryBuffer.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp
index cc3f6a8a487..580338117b8 100644
--- a/llvm/lib/Support/MemoryBuffer.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud