[largeNbDicts] Fix decompression segfault in createCompressInstructions

Benchmarking decompression results in a segfault in `createCompressInstructions`
because `cctxParams` is NULL. Skip running that function if we are not benching
compression.
This commit is contained in:
Han Zhu 2022-07-19 13:55:48 -07:00
parent 43f21a600e
commit d0c88afe6d

View File

@ -670,7 +670,9 @@ static int benchMem(slice_collection_t dstBlocks,
BMK_createTimedFnState(total_time_ms, ms_per_round);
decompressInstructions di = createDecompressInstructions(ddictionaries);
compressInstructions ci = createCompressInstructions(cdictionaries, cctxParams);
compressInstructions ci;
if (benchCompression)
ci = createCompressInstructions(cdictionaries, cctxParams);
void* payload = benchCompression ? (void*)&ci : (void*)&di;
BMK_benchParams_t const bp = {
.benchFn = benchCompression ? compress : decompress,