harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 1728db34f8b103f976a47ddd9849e5b71215e8ab
parent a00faaebe0152adec05b27f87738ed6f5f0ea133
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 14 Jan 2021 13:47:22 -0500

type_hash: fix identifier collisions

This addresses a problem where `foobar` has the same hash as `foo::bar`.

Diffstat:
Msrc/types.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/types.c b/src/types.c @@ -270,6 +270,7 @@ type_hash(const struct type *type) for (const struct identifier *ident = &type->alias.ident; ident; ident = ident->ns) { hash = fnv1a_s(hash, ident->name); + hash = fnv1a(hash, 0); } hash = fnv1a_u64(hash, type_hash(type->alias.type)); break;