- Fixes for clang static analyzer, the missing ; in

edns-subnet/addrtree.c after the assert made clang analyzer
  produce a failure to analyze it.


git-svn-id: file:///svn/unbound/trunk@4538 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2018-02-16 10:31:48 +00:00
parent a5df3a131e
commit 5b7942d197
3 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
16 February 2018: Wouter
- Fixes for clang static analyzer, the missing ; in
edns-subnet/addrtree.c after the assert made clang analyzer
produce a failure to analyze it.
13 February 2018: Ralph
- Aggressive NSEC tests

View file

@ -485,7 +485,7 @@ addrtree_find(struct addrtree *tree, const addrkey_t *addr,
/* does this node have data? if yes, see if we have a match */
if (node->elem && node->ttl >= now) {
/* saved at wrong depth */;
log_assert(node->scope >= depth)
log_assert(node->scope >= depth);
if (depth == node->scope ||
(node->scope > sourcemask &&
depth == sourcemask)) {

View file

@ -189,11 +189,17 @@ void log_vmsg(int pri, const char* type, const char* format, va_list args);
* an assertion that is thrown to the logfile.
*/
#ifdef UNBOUND_DEBUG
#ifdef __clang_analyzer__
/* clang analyzer needs to know that log_assert is an assertion, otherwise
* it could complain about the nullptr the assert is guarding against. */
#define log_assert(x) assert(x)
#else
# define log_assert(x) \
do { if(!(x)) \
fatal_exit("%s:%d: %s: assertion %s failed", \
__FILE__, __LINE__, __func__, #x); \
} while(0);
#endif
#else
# define log_assert(x) /*nothing*/
#endif