diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-06-08 17:00:08 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-06-08 17:00:08 +0000 |
| commit | 5e91c03fa9d6d9035cb0ee6481392c97d6dbd773 (patch) | |
| tree | 81bfd687c498b30577ce997b1306d343f0209c5d | |
| parent | 9bc4009e9be8050ccb9e8dbe4a1fc63ea3b33f5f (diff) | |
| download | bcm5719-llvm-5e91c03fa9d6d9035cb0ee6481392c97d6dbd773.tar.gz bcm5719-llvm-5e91c03fa9d6d9035cb0ee6481392c97d6dbd773.zip | |
For PR804:
Change the file size field of StatusInfo to be uint64_t instead of size_t
so that we know it is always 64 bits. This prevents some overflow on
systems where size_t is 32 bits when it ought to be 64.
llvm-svn: 28726
| -rw-r--r-- | llvm/include/llvm/System/Path.h | 2 | ||||
| -rw-r--r-- | llvm/lib/System/Win32/Path.inc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/System/Path.h b/llvm/include/llvm/System/Path.h index 5cbca9b31a9..bd3a5dffae5 100644 --- a/llvm/include/llvm/System/Path.h +++ b/llvm/include/llvm/System/Path.h @@ -67,7 +67,7 @@ namespace sys { struct StatusInfo { StatusInfo() : fileSize(0), modTime(0,0), mode(0777), user(999), group(999), isDir(false) { } - size_t fileSize; ///< Size of the file in bytes + uint64_t fileSize; ///< Size of the file in bytes TimeValue modTime; ///< Time of file's modification uint32_t mode; ///< Mode of the file, if applicable uint32_t user; ///< User ID of owner, if applicable diff --git a/llvm/lib/System/Win32/Path.inc b/llvm/lib/System/Win32/Path.inc index f7be77f8c90..4aab2765488 100644 --- a/llvm/lib/System/Win32/Path.inc +++ b/llvm/lib/System/Win32/Path.inc @@ -340,7 +340,7 @@ Path::getStatusInfo(StatusInfo& info) const { ThrowError("getStatusInfo():" + std::string(path) + ": Can't get status: "); info.fileSize = fi.nFileSizeHigh; - info.fileSize <<= 32; + info.fileSize <<= sizeof(fi.nFileSizeHigh)*8; info.fileSize += fi.nFileSizeLow; info.mode = fi.dwFileAttributes & FILE_ATTRIBUTE_READONLY ? 0555 : 0777; |

