Changeset 35177 in webkit
- Timestamp:
- Jul 14, 2008 7:17:56 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r35165 r35177 1 2008-07-14 Mark Rowe <mrowe@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Fix https://bugs.webkit.org/show_bug.cgi?id=20037 6 Bug 20037: GCC 4.2 build broken due to strict aliasing violation. 7 8 * kjs/ustring.cpp: 9 (KJS::UString::Rep::computeHash): Add a version of computeHash that takes a char* and explicit length. 10 * kjs/ustring.h: 11 * profiler/CallIdentifier.h: 12 (WTF::): Use new version of computeHash that takes a char* and explicit length to avoid unsafe aliasing. 13 1 14 2008-07-14 David Hyatt <hyatt@apple.com> 2 15 -
trunk/JavaScriptCore/kjs/ustring.cpp
r35027 r35177 314 314 // Paul Hsieh's SuperFastHash 315 315 // http://www.azillionmonkeys.com/qed/hash.html 316 unsigned UString::Rep::computeHash(const char* s )316 unsigned UString::Rep::computeHash(const char* s, int l) 317 317 { 318 318 // This hash is designed to work on 16-bit chunks at a time. But since the normal case … … 322 322 uint32_t hash = PHI; 323 323 uint32_t tmp; 324 size_t l = strlen(s);325 324 326 325 size_t rem = l & 1; -
trunk/JavaScriptCore/kjs/ustring.h
r35027 r35177 25 25 #include "collector.h" 26 26 #include <stdint.h> 27 #include <string.h> 27 28 #include <wtf/Assertions.h> 28 29 #include <wtf/FastMalloc.h> 29 30 #include <wtf/PassRefPtr.h> 30 31 #include <wtf/RefPtr.h> 32 #include <wtf/Vector.h> 31 33 #include <wtf/unicode/Unicode.h> 32 #include <wtf/Vector.h>33 34 34 35 namespace KJS { … … 93 94 94 95 static unsigned computeHash(const UChar*, int length); 95 static unsigned computeHash(const char*); 96 static unsigned computeHash(const char*, int length); 97 static unsigned computeHash(const char* s) { return computeHash(s, strlen(s)); } 96 98 97 99 Rep* ref() { ++rc; return this; } -
trunk/JavaScriptCore/profiler/CallIdentifier.h
r35096 r35177 71 71 key.m_lineNumber 72 72 }; 73 return KJS::UString::Rep::computeHash(reinterpret_cast< UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar));73 return KJS::UString::Rep::computeHash(reinterpret_cast<char*>(hashCodes), sizeof(hashCodes)); 74 74 } 75 75
Note: See TracChangeset
for help on using the changeset viewer.