Skip to content

Bad hpc hash function

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.

Trac metadata
Trac field Value
Version 7.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Code Coverage
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information