http://llvm.org/bugs/show_bug.cgi?id=13726
Bug #: 13726
Summary: HashString implements Bernstein hash using signed
char, instead of traditional unsigned char
Product: new-bugs
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
HashString() in include/llvm/ADT/StringExtras.h has comments saying it
implements the Bernstein hash function.
However, all posted implementations of this hash (including the one at the URL
mentioned in the source) that I can find define it in terms of unsigned char's,
not the signed ones that the current implementation uses.
This causes the HashString function to produce different hashes for strings
containing characters >= 128.
I have not experimented to see the effects "fixing" this would have, but it
seems that we should either use the algorithm as posted or have a reason for
deviating (mentioned in the source).
HashString is used by code like StringMap, FWIW.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs