From b05d459a134cfc1bb672829e896291fc9616edbe Mon Sep 17 00:00:00 2001 From: Krzysztof Furman Date: Fri, 12 Jun 2026 21:33:56 +0100 Subject: [PATCH] Make the type hash 63-bit to not crash OMG JIT in WebKit under WASM. --- src/name_canonicalization.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/name_canonicalization.cpp b/src/name_canonicalization.cpp index 1a4ca6439..ccd65e610 100644 --- a/src/name_canonicalization.cpp +++ b/src/name_canonicalization.cpp @@ -520,6 +520,8 @@ gb_internal u64 type_hash_canonical_type(Type *type) { type_writer_make_hasher(&w, &w.hash_ctx); write_type_to_canonical_string(&w, type); u64 hash = typeid_hash_context_fini(&w.hash_ctx); + hash &= 0x7fffffffffffffffull; + hash = hash ? hash : 1; type->canonical_hash.store(hash, std::memory_order_relaxed);