summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
authorIvan Krasin <krasin@chromium.org>2011-09-15 23:13:00 +0000
committerIvan Krasin <krasin@chromium.org>2011-09-15 23:13:00 +0000
commit639222d0902f0aff52c51c850b29369e017eef83 (patch)
tree6a99e9d8ead4106f53541398c10af4365be7b1b3 /llvm/lib/Support/MemoryBuffer.cpp
parent7b43568a932089edcf4d8eea269748cafbca60e0 (diff)
downloadbcm5719-llvm-639222d0902f0aff52c51c850b29369e017eef83.tar.gz
bcm5719-llvm-639222d0902f0aff52c51c850b29369e017eef83.zip
use 64-bit types instead of off_t/size_t to avoid the issue when
gold plugin is built with Large File Support (sizeof(off_t) == 64 on i686) and the rest of LLVM is built w/o Large File Support (sizeof(off_t) == 32 on i686) which corrupts the stack. llvm-svn: 139873
Diffstat (limited to 'llvm/lib/Support/MemoryBuffer.cpp')
-rw-r--r--llvm/lib/Support/MemoryBuffer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp
index d264be9aced..0771af5fee0 100644
--- a/llvm/lib/Support/MemoryBuffer.cpp
+++ b/llvm/lib/Support/MemoryBuffer.cpp
@@ -275,16 +275,16 @@ static bool shouldUseMmap(int FD,
error_code MemoryBuffer::getOpenFile(int FD, const char *Filename,
OwningPtr<MemoryBuffer> &result,
- size_t FileSize, size_t MapSize,
- off_t Offset,
+ uint64_t FileSize, uint64_t MapSize,
+ int64_t Offset,
bool RequiresNullTerminator) {
static int PageSize = sys::Process::GetPageSize();
// Default is to map the full file.
- if (MapSize == size_t(-1)) {
+ if (MapSize == uint64_t(-1)) {
// If we don't know the file size, use fstat to find out. fstat on an open
// file descriptor is cheaper than stat on a random path.
- if (FileSize == size_t(-1)) {
+ if (FileSize == uint64_t(-1)) {
struct stat FileInfo;
// TODO: This should use fstat64 when available.
if (fstat(FD, &FileInfo) == -1) {
OpenPOWER on IntegriCloud