diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp --- a/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp @@ -19,7 +19,7 @@ namespace __sanitizer { struct StackDepotNode { - using hash_type = u32; + using hash_type = u64; StackDepotNode *link; u32 id; hash_type stack_hash; @@ -34,22 +34,17 @@ typedef StackTrace args_type; bool eq(hash_type hash, const args_type &args) const { - u32 tag = - atomic_load(&tag_and_use_count, memory_order_relaxed) >> kUseCountBits; - if (stack_hash != hash || args.size != size || args.tag != tag) - return false; - uptr i = 0; - for (; i < size; i++) { - if (stack[i] != args.trace[i]) return false; - } - return true; + return hash == stack_hash; } static uptr storage_size(const args_type &args) { return sizeof(StackDepotNode) + (args.size - 1) * sizeof(uptr); } static hash_type hash(const args_type &args) { - MurMur2HashBuilder H(args.size * sizeof(uptr)); + MurMur2Hash64Builder H(args.size * sizeof(uptr)); for (uptr i = 0; i < args.size; i++) H.add(args.trace[i]); + u32 tag = + atomic_load(&tag_and_use_count, memory_order_relaxed) >> kUseCountBits; + H.add(tag); return H.get(); } static bool is_valid(const args_type &args) {