CBOR reader: mark the initial accepted in the scalar run as a false-positive dead store

ci_infer reports DEAD_STORE for 'bool accepted = true;' in
parse_cbor_scalar_run because every case assigns accepted before it is read.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-31 20:20:16 +01:00
1 parent 8bbfb5ec1d
commit bf81ab564f
2 files changed
+4

No files matched your search

@@ -1715,6 +1715,8 @@ class binary_reader
const auto* const data = reinterpret_cast<const unsigned char*>(ia.bulk_data());
const unsigned char head = data[0];
std::size_t size = 0;
// false positive: every case assigns accepted before it is read
// @infer-ignore DEAD_STORE
bool accepted = true;
switch (head)
{
+2
View File
@@ -19491,6 +19491,8 @@ class binary_reader
const auto* const data = reinterpret_cast<const unsigned char*>(ia.bulk_data());
const unsigned char head = data[0];
std::size_t size = 0;
// false positive: every case assigns accepted before it is read
// @infer-ignore DEAD_STORE
bool accepted = true;
switch (head)
{