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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28726 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2006-06-08 17:00:08 +00:00
parent 28962f353b
commit 393830a33a
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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;