Bug 26334

Summary: WTF::FloatHash is invalid for 0 / -0
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: JavaScriptCoreAssignee: 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
Reported 2009-06-11 15:39:30 PDT
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
Ahmad Saleem
Comment 1 2022-07-21 13:18:34 PDT
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
Comment 2 2022-07-21 13:21:48 PDT
Seems like it indeed. *** This bug has been marked as a duplicate of bug 98627 ***
Note You need to log in before you can comment on or make changes to this bug.