aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/MemoryBuffer.cpp')
-rw-r--r--lib/Support/MemoryBuffer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
index cab45c7..1c45c69 100644
--- a/lib/Support/MemoryBuffer.cpp
+++ b/lib/Support/MemoryBuffer.cpp
@@ -276,7 +276,7 @@ static bool shouldUseMmap(int FD,
int PageSize) {
// We don't use mmap for small files because this can severely fragment our
// address space.
- if (MapSize < 4096*4)
+ if (MapSize < 4 * 4096 || MapSize < (unsigned)PageSize)
return false;
if (!RequiresNullTerminator)