aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2012-08-21 17:32:13 -0700
committerDerek Schuff <dschuff@chromium.org>2012-08-21 17:32:13 -0700
commit66f271497ed92ebb05c66f54616e512606a2e314 (patch)
tree96d54cd64804ab7c9f2f52f680c3301aa789ce1d /lib/Support/MemoryBuffer.cpp
parentb62e9abf7dd9e39c95327914ce9dfe216386824a (diff)
parentbc363931085587bac42a40653962a3e5acd1ffce (diff)
Merge up to r162331, git commit bc363931085587bac42a40653962a3e5acd1ffce
Diffstat (limited to 'lib/Support/MemoryBuffer.cpp')
-rw-r--r--lib/Support/MemoryBuffer.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
index 816f7c223b..61d51b6b48 100644
--- a/lib/Support/MemoryBuffer.cpp
+++ b/lib/Support/MemoryBuffer.cpp
@@ -324,16 +324,6 @@ error_code MemoryBuffer::getOpenFile(int FD, const char *Filename,
RealMapOffset)) {
result.reset(GetNamedBuffer<MemoryBufferMMapFile>(
StringRef(Pages + Delta, MapSize), Filename, RequiresNullTerminator));
-
- if (RequiresNullTerminator && result->getBufferEnd()[0] != '\0') {
- // There could be a racing issue that resulted in the file being larger
- // than the FileSize passed by the caller. We already have an assertion
- // for this in MemoryBuffer::init() but have a runtime guarantee that
- // the buffer will be null-terminated here, so do a copy that adds a
- // null-terminator.
- result.reset(MemoryBuffer::getMemBufferCopy(result->getBuffer(),
- Filename));
- }
return error_code::success();
}
}