summaryrefslogtreecommitdiffstats
path: root/Utilities/cmzstd
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmzstd')
-rw-r--r--Utilities/cmzstd/lib/common/bitstream.h2
-rw-r--r--Utilities/cmzstd/lib/compress/fse_compress.c4
-rw-r--r--Utilities/cmzstd/lib/dictBuilder/divsufsort.c11
3 files changed, 17 insertions, 0 deletions
diff --git a/Utilities/cmzstd/lib/common/bitstream.h b/Utilities/cmzstd/lib/common/bitstream.h
index 2e5a933..136a188 100644
--- a/Utilities/cmzstd/lib/common/bitstream.h
+++ b/Utilities/cmzstd/lib/common/bitstream.h
@@ -14,6 +14,8 @@
#ifndef BITSTREAM_H_MODULE
#define BITSTREAM_H_MODULE
+#include <assert.h>
+
#if defined (__cplusplus)
extern "C" {
#endif
diff --git a/Utilities/cmzstd/lib/compress/fse_compress.c b/Utilities/cmzstd/lib/compress/fse_compress.c
index b4297ec..1b6a076 100644
--- a/Utilities/cmzstd/lib/compress/fse_compress.c
+++ b/Utilities/cmzstd/lib/compress/fse_compress.c
@@ -646,6 +646,10 @@ size_t FSE_compress_wksp (void* dst, size_t dstSize, const void* src, size_t src
void* scratchBuffer = (void*)(CTable + CTableSize);
size_t const scratchBufferSize = wkspSize - (CTableSize * sizeof(FSE_CTable));
+#ifdef __clang_analyzer__
+ memset(norm, 0, sizeof(norm));
+#endif
+
/* init conditions */
if (wkspSize < FSE_COMPRESS_WKSP_SIZE_U32(tableLog, maxSymbolValue)) return ERROR(tableLog_tooLarge);
if (srcSize <= 1) return 0; /* Not compressible */
diff --git a/Utilities/cmzstd/lib/dictBuilder/divsufsort.c b/Utilities/cmzstd/lib/dictBuilder/divsufsort.c
index a2870fb..8d52b18 100644
--- a/Utilities/cmzstd/lib/dictBuilder/divsufsort.c
+++ b/Utilities/cmzstd/lib/dictBuilder/divsufsort.c
@@ -40,6 +40,10 @@
#include <stdio.h>
#include <stdlib.h>
+#ifdef __clang_analyzer__
+#include <string.h>
+#endif
+
#include "divsufsort.h"
/*- Constants -*/
@@ -1119,6 +1123,9 @@ tr_copy(int *ISA, const int *SA,
v = b - SA - 1;
for(c = first, d = a - 1; c <= d; ++c) {
+ #ifdef __clang_analyzer__
+ assert(c);
+ #endif
if((0 <= (s = *c - depth)) && (ISA[s] == v)) {
*++d = s;
ISA[s] = d - SA;
@@ -1184,6 +1191,10 @@ tr_introsort(int *ISA, const int *ISAd,
int limit, next;
int ssize, trlink = -1;
+ #ifdef __clang_analyzer__
+ memset(stack, 0, sizeof(stack));
+ #endif
+
for(ssize = 0, limit = tr_ilg(last - first);;) {
if(limit < 0) {