From 7ec3aad20f04a51d7b3089374f3ea36b496eb8f5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 2 Jun 2022 10:50:55 -0600 Subject: [PATCH] [shared_ptr] Fix hb_hash() crash on nullptr --- src/hb-algs.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 02c5a8697..34e512e7e 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -245,7 +245,7 @@ struct template constexpr uint32_t impl (const hb::shared_ptr& v, hb_priority<1>) const { - return (uint32_t) (intptr_t) v.get ()->hash (); + return v.get () ? v.get ()->hash () : 0; } template constexpr auto