Stop spurious clang shallow analysis null pointer errors

Avoid 4 null pointer errors under clang shallow analysis (the default when
building under Xcode) by using tor_assert() to prove that the pointers
aren't null. Resolves issue 13284 via minor code refactoring.
This commit is contained in:
teor
2014-09-29 10:08:37 +10:00
committed by Nick Mathewson
parent 5190ec0bc4
commit ff8fe38a2f
4 changed files with 9 additions and 0 deletions
+2
View File
@@ -1395,6 +1395,8 @@ dirserv_compute_performance_thresholds(routerlist_t *rl,
routerinfo_t *ri = node->ri;
const char *id = node->identity;
uint32_t bw_kb;
/* resolve spurious clang shallow analysis null pointer errors */
tor_assert(ri);
node->is_exit = (!router_exit_policy_rejects_all(ri) &&
exit_policy_is_general_exit(ri->exit_policy));
uptimes[n_active] = (uint32_t)real_uptime(ri, now);