From 57c02a59053727cdb2210c26e13099c10dd7440b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 12 Jan 2020 21:57:34 -0800 Subject: hash: bug: not hashing key of tree node. * hash.c (equal_hash): Spurious semicolon in TNOD case causing part of expression that includes the key to be cut off. This was not diagnosed by the C compiler of GCC 4.x or 7.4.0. The GCC 7.4.0 C++ front end caught this bug. --- hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index f3f5e3f4..599f35f1 100644 --- a/hash.c +++ b/hash.c @@ -269,7 +269,7 @@ ucnum equal_hash(val obj, int *count, ucnum seed) return hash_buf(obj->b.data, c_unum(obj->b.len), seed, count); case TNOD: return equal_hash(obj->tn.left, count, (seed + TNOD)) - + equal_hash(obj->tn.right, count, seed + (TNOD << 8)); + + equal_hash(obj->tn.right, count, seed + (TNOD << 8)) + equal_hash(obj->tn.key, count, seed + (TNOD << 16)); } -- cgit v1.2.3