Absl may pick wrong template function for hashing CollatorInterface*

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • 53
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      There are two possible templated functions which absl could use to hash a CollatorInterface*; unfortunately, instead of picking the custom one in expression_hasher.cpp, it picks the default hash function which uses the value of the pointer. This results in two equivalent expressions with collators defined hashing to different values, causing a build failure (BF-29584) in unit tests exercising this behavior.

      The simple fix is to just avoid the ambiguous choice of template functions by directly checking if the collator interface is non-null, and passing a reference to the collation instance directly to the hash function.

            Assignee:
            Alya Berciu
            Reporter:
            Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: