From 395f0cb69c8db2b4a36dc40d9776df9bea5afdb1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 22 May 2023 10:00:42 -0400 Subject: nghttp2: Suppress clang-analyzer warnings --- Utilities/cmnghttp2/lib/nghttp2_buf.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Utilities/cmnghttp2/lib/nghttp2_buf.c b/Utilities/cmnghttp2/lib/nghttp2_buf.c index a328447..ce51251 100644 --- a/Utilities/cmnghttp2/lib/nghttp2_buf.c +++ b/Utilities/cmnghttp2/lib/nghttp2_buf.c @@ -26,6 +26,10 @@ #include +#ifdef __clang_analyzer__ +#include +#endif + #include "nghttp2_helper.h" #include "nghttp2_debug.h" @@ -386,6 +390,10 @@ int nghttp2_bufs_addb(nghttp2_bufs *bufs, uint8_t b) { return rv; } +#ifdef __clang_analyzer__ + assert(bufs->cur->buf.last); +#endif + *bufs->cur->buf.last++ = b; return 0; @@ -399,6 +407,10 @@ int nghttp2_bufs_addb_hold(nghttp2_bufs *bufs, uint8_t b) { return rv; } +#ifdef __clang_analyzer__ + assert(bufs->cur->buf.last); +#endif + *bufs->cur->buf.last = b; return 0; @@ -412,6 +424,10 @@ int nghttp2_bufs_orb(nghttp2_bufs *bufs, uint8_t b) { return rv; } +#ifdef __clang_analyzer__ + assert(bufs->cur->buf.last); +#endif + *bufs->cur->buf.last++ |= b; return 0; -- cgit v0.12