From f8f82901cdd0ccd5308e05c73af6deb7d083720f Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 1 Feb 2023 12:54:22 +0100 Subject: fix(tests): fixes for using vim.mpack and more ASAN --- src/mpack/object.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/mpack/object.c') diff --git a/src/mpack/object.c b/src/mpack/object.c index e2d893bc88..60f49f73aa 100644 --- a/src/mpack/object.c +++ b/src/mpack/object.c @@ -128,8 +128,11 @@ MPACK_API int mpack_unparse(mpack_parser_t *parser, char **buf, size_t *buflen, return status; } -MPACK_API void mpack_parser_copy(mpack_parser_t *dst, mpack_parser_t *src) +MPACK_API void mpack_parser_copy(mpack_parser_t *d, mpack_parser_t *s) { + // workaround UBSAN being NOT happy with a flexible array member with arr[N>1] initial size + mpack_one_parser_t *dst = (mpack_one_parser_t *)d; + mpack_one_parser_t *src = (mpack_one_parser_t *)s; mpack_uint32_t i; mpack_uint32_t dst_capacity = dst->capacity; assert(src->capacity <= dst_capacity); @@ -148,8 +151,9 @@ static int mpack_parser_full(mpack_parser_t *parser) return parser->size == parser->capacity; } -static mpack_node_t *mpack_parser_push(mpack_parser_t *parser) +static mpack_node_t *mpack_parser_push(mpack_parser_t *p) { + mpack_one_parser_t *parser = (mpack_one_parser_t *)p; mpack_node_t *top; assert(parser->size < parser->capacity); top = parser->items + parser->size + 1; @@ -162,8 +166,9 @@ static mpack_node_t *mpack_parser_push(mpack_parser_t *parser) return top; } -static mpack_node_t *mpack_parser_pop(mpack_parser_t *parser) +static mpack_node_t *mpack_parser_pop(mpack_parser_t *p) { + mpack_one_parser_t *parser = (mpack_one_parser_t *)p; mpack_node_t *top, *parent; assert(parser->size); top = parser->items + parser->size; -- cgit From 353a4be7e84fdc101318215bdcc8a7e780d737fe Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 12 Nov 2023 13:13:58 +0100 Subject: build: remove PVS We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable. --- src/mpack/object.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/mpack/object.c') diff --git a/src/mpack/object.c b/src/mpack/object.c index 60f49f73aa..ec128690d7 100644 --- a/src/mpack/object.c +++ b/src/mpack/object.c @@ -1,6 +1,3 @@ -// This is an open source non-commercial project. Dear PVS-Studio, please check -// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com - #include #include "object.h" -- cgit