From a21a3c26204b35a6e26cd26f0a1ea68e8b0c5564 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sat, 11 Sep 2021 16:45:04 +0430 Subject: [PATCH] AK: Make traits for NonnullOwnPtr use ptr_hash instead of int_hash Otherwise they'd be truncating the pointer in 64-bit builds. --- AK/NonnullOwnPtr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index 6c781c352b..91ea1f15ce 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -176,7 +176,7 @@ template struct Traits> : public GenericTraits> { using PeekType = T*; using ConstPeekType = const T*; - static unsigned hash(const NonnullOwnPtr& p) { return int_hash((u32)p.ptr()); } + static unsigned hash(const NonnullOwnPtr& p) { return ptr_hash((FlatPtr)p.ptr()); } static bool equals(const NonnullOwnPtr& a, const NonnullOwnPtr& b) { return a.ptr() == b.ptr(); } };