decompress: conditionally remove bmi2 from context

Use an helper function, which will just return 0 in case
the feature is disabled.
Allows constant propagation and removal of dead code.
This commit is contained in:
Norbert Lange
2021-09-26 14:41:37 +02:00
parent 02296cac82
commit 0d45540695
4 changed files with 23 additions and 11 deletions
+3 -1
View File
@@ -261,7 +261,9 @@ static void ZSTD_initDCtx_internal(ZSTD_DCtx* dctx)
#endif
dctx->noForwardProgress = 0;
dctx->oversizedDuration = 0;
dctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid());
#if DYNAMIC_BMI2
dctx->bmi2 = ZSTD_cpuid_bmi2(ZSTD_cpuid())
#endif
dctx->ddictSet = NULL;
ZSTD_DCtx_resetParameters(dctx);
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION