From: Alan T. DeKok Date: Wed, 19 Jan 2022 16:14:00 +0000 (-0500) Subject: shut up clang analyzer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e95cf40fcc39e79e32be197d8a054cea69d082a9;p=thirdparty%2Ffreeradius-server.git shut up clang analyzer --- diff --git a/src/lib/unlang/xlat_expr.c b/src/lib/unlang/xlat_expr.c index 3a3c991aad..4ae60121ec 100644 --- a/src/lib/unlang/xlat_expr.c +++ b/src/lib/unlang/xlat_expr.c @@ -168,8 +168,13 @@ static xlat_action_t xlat_binary_op(TALLOC_CTX *ctx, fr_dcursor_t *out, a = fr_dlist_head(in); b = fr_dlist_next(in, a); +#ifdef __clang_analyzer__ + if (!a || !b) retunr XLAT_ACTION_FAIL; +#else fr_assert(a != NULL); fr_assert(b != NULL); +#endif + rcode = fr_value_calc_binary_op(dst, dst, FR_TYPE_NULL, a, op, b); if (rcode < 0) { diff --git a/src/lib/unlang/xlat_priv.h b/src/lib/unlang/xlat_priv.h index 646badf11b..b898299e92 100644 --- a/src/lib/unlang/xlat_priv.h +++ b/src/lib/unlang/xlat_priv.h @@ -165,7 +165,7 @@ typedef struct { * For needs_async, if both the parent and the child are needs_async, the parent is * needs_async. */ -static inline void xlat_flags_merge(xlat_flags_t *parent, xlat_flags_t const *child) +static inline CC_HINT(nonnull) void xlat_flags_merge(xlat_flags_t *parent, xlat_flags_t const *child) { parent->needs_async |= child->needs_async; parent->needs_resolving |= child->needs_resolving;