]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed static analyzer false positive regarding @sequence initialization 3677/head
authorYann Collet <cyan@fb.com>
Fri, 16 Jun 2023 23:24:48 +0000 (16:24 -0700)
committerYann Collet <cyan@fb.com>
Fri, 16 Jun 2023 23:24:48 +0000 (16:24 -0700)
make a mock initialization to please the tool

lib/decompress/zstd_decompress_block.c

index 0d6c2e01103dc6243c5ddd7b0c8140dd065f4653..c90536ad716c1114592d39d4cbe2c1c63fabe976 100644 (file)
@@ -1429,7 +1429,7 @@ ZSTD_decompressSequences_bodySplitLitBuffer( ZSTD_DCtx* dctx,
                 BIT_DStream_completed < BIT_DStream_overflow);
 
         /* decompress without overrunning litPtr begins */
-        {   seq_t sequence;
+        {   seq_t sequence = {0,0,0};  /* some static analyzer believe that @sequence is not initialized (it necessarily is, since for(;;) loop as at least one interation) */
             /* Align the decompression loop to 32 + 16 bytes.
                 *
                 * zstd compiled with gcc-9 on an Intel i9-9900k shows 10% decompression