From 26f0982c830083bc5a70a0adcdfd80bfb5b7698c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 2 May 2025 17:27:16 -0400 Subject: Fix bug where fallbacks were hashed by pointer instead of by contents --- src/stdlib/tables.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/stdlib/tables.c') diff --git a/src/stdlib/tables.c b/src/stdlib/tables.c index c374f26f..061c3391 100644 --- a/src/stdlib/tables.c +++ b/src/stdlib/tables.c @@ -559,13 +559,12 @@ PUREFUNC public uint64_t Table$hash(const void *obj, const TypeInfo_t *type) volatile struct { int64_t length; - uint64_t keys_hash, values_hash; - Table_t *fallback; + uint64_t keys_hash, values_hash, fallback_hash; } components = { t->entries.length, keys_hash, values_hash, - t->fallback, + t->fallback ? Table$hash(t->fallback, type) : 0, }; t->hash = siphash24((void*)&components, sizeof(components)); if unlikely (t->hash == 0) -- cgit v1.2.3