diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-01-12 21:57:34 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-01-12 21:57:34 -0800 |
commit | 57c02a59053727cdb2210c26e13099c10dd7440b (patch) | |
tree | 7a41a7ad4f631ded6bcb6b4358d25d4d60be9a66 /hash.c | |
parent | b9220d84639ca227e130aab22d81a530b244a5f6 (diff) | |
download | txr-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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)); } |