Changeset 231035 in webkit
- Timestamp:
- Apr 25, 2018, 5:13:35 PM (7 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r231027 r231035 1 2018-04-25 Mark Lam <mark.lam@apple.com> 2 3 Gardening: Speculative build fix for Windows 32-bit to compensate for MSVC's lack of smarts. 4 https://bugs.webkit.org/show_bug.cgi?id=184976 5 <rdar://problem/39723901> 6 7 Not reviewed. 8 9 According to https://stackoverflow.com/questions/37658794/integer-constant-overflow-warning-in-constexpr, 10 disabling the warning around the definition of the function will not disable it 11 for all clients of the function. 12 13 * wtf/PtrTag.h: 14 (WTF::makePtrTagHash): 15 1 16 2018-04-25 Mark Lam <mark.lam@apple.com> 2 17 -
trunk/Source/WTF/wtf/PtrTag.h
r231027 r231035 49 49 constexpr uintptr_t makePtrTagHash(const char (&str)[N]) 50 50 { 51 // The only reason for the following dance with casting to result64Bit and 52 // back is because, on 32-bit, MSVC will complain about "C4307: integral 53 // constant overflow" but not allow us to disable the warning for all clients 54 // of this function. 51 55 uintptr_t result = 134775813; 52 for (size_t i = 0; i < N; ++i) 53 result += ((result * str[i]) ^ (result >> 16)); 56 for (size_t i = 0; i < N; ++i) { 57 uint64_t result64Bit = static_cast<uint64_t>(result); 58 result64Bit += ((result64Bit * str[i]) ^ (result64Bit >> 16)); 59 result = static_cast<uintptr_t>(result64Bit); 60 } 54 61 return result & 0xffff; 55 62 }
Note:
See TracChangeset
for help on using the changeset viewer.