When using -O2 with GCC, it liked to swap two comparisons
in one "if" statement. It's otherwise fine except that
the latter part, which is seemingly never executed, got
executed (nothing wrong with that) and then triggered
warning in Valgrind about conditional jump depending on
uninitialized variable. A few people find this annoying
so do things a bit differently to avoid the warning.
// Deallocate the old hash array if it exists and has different size
// than what is needed now.
- if (mf->hash != NULL && old_count != new_count) {
+ if (old_count != new_count) {
lzma_free(mf->hash, allocator);
mf->hash = NULL;
}
lzma_mf mf = {
.buffer = NULL,
.hash = NULL,
+ .hash_size_sum = 0,
+ .sons_count = 0,
};
// Setup the size information into mf.
next->coder->mf.buffer = NULL;
next->coder->mf.hash = NULL;
+ next->coder->mf.hash_size_sum = 0;
+ next->coder->mf.sons_count = 0;
next->coder->next = LZMA_NEXT_CODER_INIT;
}