summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-01-12 21:57:34 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-01-12 21:57:34 -0800
commit57c02a59053727cdb2210c26e13099c10dd7440b (patch)
tree7a41a7ad4f631ded6bcb6b4358d25d4d60be9a66 /hash.c
parentb9220d84639ca227e130aab22d81a530b244a5f6 (diff)
downloadtxr-57c02a59053727cdb2210c26e13099c10dd7440b.tar.gz
txr-57c02a59053727cdb2210c26e13099c10dd7440b.tar.bz2
txr-57c02a59053727cdb2210c26e13099c10dd7440b.zip
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.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 1 insertions, 1 deletions
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));
}