Ticket #5944 (closed bug: fixed)
Bad hpc hash function
| Reported by: | Lennart | Owned by: | simonmar |
|---|---|---|---|
| Priority: | high | Milestone: | 7.4.2 |
| Component: | Code Coverage | Version: | 7.2.2 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
In the hpc module Trace.Hpc.Util there is the following code:
instance (HpcHash a,HpcHash b) => HpcHash (a,b) where toHash (a,b) = toHash a * 33 `hxor` toHash b
This is bad and I can only presume that what was actually intended was
instance (HpcHash a,HpcHash b) => HpcHash (a,b) where toHash (a,b) = (toHash a * 33) `hxor` toHash b
Otherwise a hash of 0 for a will result in a total hash of 0.
Change History
Note: See
TracTickets for help on using
tickets.
