mirror of
https://github.com/facebook/zstd.git
synced 2024-11-27 09:26:45 +08:00
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!
This commit is contained in:
parent
1c007e64b8
commit
cdceb0fce5
@ -1340,8 +1340,9 @@ ZSTD_decodeSequence(seqState_t* seqState, const ZSTD_longOffset_e longOffsets, c
|
||||
return seq;
|
||||
}
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
MEM_STATIC int ZSTD_dictionaryIsActive(ZSTD_DCtx const* dctx, BYTE const* prefixStart, BYTE const* oLitEnd)
|
||||
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && defined(FUZZING_ASSERT_VALID_SEQUENCE)
|
||||
#if DEBUGLEVEL >= 1
|
||||
static int ZSTD_dictionaryIsActive(ZSTD_DCtx const* dctx, BYTE const* prefixStart, BYTE const* oLitEnd)
|
||||
{
|
||||
size_t const windowSize = dctx->fParams.windowSize;
|
||||
/* No dictionary used. */
|
||||
@ -1355,8 +1356,9 @@ MEM_STATIC int ZSTD_dictionaryIsActive(ZSTD_DCtx const* dctx, BYTE const* prefix
|
||||
/* Dictionary is active. */
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
MEM_STATIC void ZSTD_assertValidSequence(
|
||||
static void ZSTD_assertValidSequence(
|
||||
ZSTD_DCtx const* dctx,
|
||||
BYTE const* op, BYTE const* oend,
|
||||
seq_t const seq,
|
||||
|
Loading…
Reference in New Issue
Block a user