Skip to content

Commit cdceb0f

Browse files
committed
Improve macro guards for ZSTD_assertValidSequence
Refine the macro guards to define the functions exactly when they are needed. This fixes the chromium build with zstd. Thanks to @GregTho for reporting!
1 parent 1c007e6 commit cdceb0f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/decompress/zstd_decompress_block.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1340,8 +1340,9 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets, c
13401340
return seq;
13411341
}
13421342

1343-
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
1344-
MEM_STATIC int ZSTD_dictionaryIsActive(ZSTD_DCtx const* dctx, BYTE const* prefixStart, BYTE const* oLitEnd)
1343+
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
1344+
#if DEBUGLEVEL >= 1
1345+
static int ZSTD_dictionaryIsActive(ZSTD_DCtx const* dctx, BYTE const* prefixStart, BYTE const* oLitEnd)
13451346
{
13461347
size_t const windowSize = dctx->fParams.windowSize;
13471348
/* No dictionary used. */
@@ -1355,8 +1356,9 @@ MEM_STATIC int ZSTD_dictionaryIsActive(ZSTD_DCtx const* dctx, BYTE const* prefix
13551356
/* Dictionary is active. */
13561357
return 1;
13571358
}
1359+
#endif
13581360

1359-
MEM_STATIC void ZSTD_assertValidSequence(
1361+
static void ZSTD_assertValidSequence(
13601362
ZSTD_DCtx const* dctx,
13611363
BYTE const* op, BYTE const* oend,
13621364
seq_t const seq,

0 commit comments

Comments
 (0)