From fe612c4b1b5de638a753dd66e6225b47cc2d2496 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Sun, 26 Nov 2023 20:13:22 -0300 Subject: [PATCH] [Core] Fix crash when hashing empty CharString --- core/templates/hashfuncs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/templates/hashfuncs.h b/core/templates/hashfuncs.h index 2a212f3dcb18..05960292f5fd 100644 --- a/core/templates/hashfuncs.h +++ b/core/templates/hashfuncs.h @@ -310,7 +310,7 @@ struct HashMapHasherDefault { static _FORCE_INLINE_ uint32_t hash(const char16_t p_uchar) { return hash_fmix32(p_uchar); } static _FORCE_INLINE_ uint32_t hash(const char32_t p_uchar) { return hash_fmix32(p_uchar); } static _FORCE_INLINE_ uint32_t hash(const RID &p_rid) { return hash_one_uint64(p_rid.get_id()); } - static _FORCE_INLINE_ uint32_t hash(const CharString &p_char_string) { return hash_djb2(p_char_string.ptr()); } + static _FORCE_INLINE_ uint32_t hash(const CharString &p_char_string) { return hash_djb2(p_char_string.get_data()); } static _FORCE_INLINE_ uint32_t hash(const StringName &p_string_name) { return p_string_name.hash(); } static _FORCE_INLINE_ uint32_t hash(const NodePath &p_path) { return p_path.hash(); } static _FORCE_INLINE_ uint32_t hash(const ObjectID &p_id) { return hash_one_uint64(p_id); }