diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2009-11-06 10:22:49 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2009-11-06 22:00:37 +0300 |
commit | 4139c9af86edfb9a6d4846518f12f6347632bdc9 (patch) | |
tree | 3be544047ee228498c0e8254c1414899ed3685d8 /hashtbl.c | |
parent | 2967fee0bbf73e0b0590ef2ef66035d340a5f944 (diff) | |
download | nasm-4139c9af86edfb9a6d4846518f12f6347632bdc9.tar.gz nasm-4139c9af86edfb9a6d4846518f12f6347632bdc9.tar.bz2 nasm-4139c9af86edfb9a6d4846518f12f6347632bdc9.zip |
hash_init: check for size being power of two
It's really a bug if size is not power of
two. We must to be sure all callers are
sane.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'hashtbl.c')
-rw-r--r-- | hashtbl.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -63,6 +63,7 @@ static struct hash_tbl_node *alloc_table(size_t newsize) void hash_init(struct hash_table *head, size_t size) { + nasm_assert(is_power2(size)); head->table = alloc_table(size); head->load = 0; head->size = size; |