Workaround for clang static analyzer bug.

This commit is contained in:
Witold Kręcicki
2020-03-02 14:12:05 +01:00
parent 47e5f5564c
commit 6c8f309745

View File

@@ -150,6 +150,14 @@ badcache_resize(dns_badcache_t *bc, isc_time_t *now) {
newsize = bc->size * 2 + 1;
} else {
newsize = (bc->size - 1) / 2;
#ifdef __clang_analyzer__
/*
* XXXWPK there's a bug in clang static analyzer -
* `value % newsize` is considered undefined even though
* we check if newsize is larger than 0. This helps.
*/
newsize += 1;
#endif
}
RUNTIME_CHECK(newsize > 0);