Ignore:
Timestamp:
Jul 14, 2008, 7:17:56 PM (17 years ago)
Author:
[email protected]
Message:

Fix https://bugs.webkit.org/show_bug.cgi?id=20037
Bug 20037: GCC 4.2 build broken due to strict aliasing violation.

Reviewed by Sam Weinig.

  • kjs/ustring.cpp:

(KJS::UString::Rep::computeHash): Add a version of computeHash that takes a char* and explicit length.

  • kjs/ustring.h:
  • profiler/CallIdentifier.h:

(WTF::): Use new version of computeHash that takes a char* and explicit length to avoid unsafe aliasing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ustring.cpp

    r35027 r35177  
    314314// Paul Hsieh's SuperFastHash
    315315// http://www.azillionmonkeys.com/qed/hash.html
    316 unsigned UString::Rep::computeHash(const char* s)
     316unsigned UString::Rep::computeHash(const char* s, int l)
    317317{
    318318    // This hash is designed to work on 16-bit chunks at a time. But since the normal case
     
    322322    uint32_t hash = PHI;
    323323    uint32_t tmp;
    324     size_t l = strlen(s);
    325324
    326325    size_t rem = l & 1;
Note: See TracChangeset for help on using the changeset viewer.