Bug 26334
Summary: | WTF::FloatHash is invalid for 0 / -0 | ||
---|---|---|---|
Product: | WebKit | Reporter: | Geoffrey Garen <ggaren> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, mjs, rniwa, ysuzuki |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 |
Geoffrey Garen
Because FloatHash does a bitwise hash, 0 and -0 get different hash values, even though they compare equal. That's a hash table no-no.
More info here: http://virtualdub.org/blog/pivot/entry.php?id=259.
Simplest solution is to mask the sign bit when computing a FloatHash. Another option is to treat -0 as a special case, and return the hash value for 0.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
I think it got fixed in following commit:
https://github.com/WebKit/WebKit/commit/cf04259b238524f34209400f7fc0962b7473f03f
I think this can be marked as RESOLVED INVALID or RESOLVED CONFIGURATION CHANGED. Thanks!
Alexey Proskuryakov
Seems like it indeed.
*** This bug has been marked as a duplicate of bug 98627 ***