Skip to content
Snippets Groups Projects
Commit c3c2cd9c6a9d authored by Lasse Collin's avatar Lasse Collin
Browse files

liblzma: Make Valgrind happier with optimized (gcc -O2) liblzma.

When optimizing, GCC can reorder code so that an uninitialized
value gets used in a comparison, which makes Valgrind unhappy.
It doesn't happen when compiled with -O0, which I tend to use
when running Valgrind.

Thanks to Rich Prohaska. I remember this being mentioned long
ago by someone else but nothing was done back then.
parent 8d9bb249ba7c
No related branches found
No related tags found
No related merge requests found
......@@ -541,4 +541,7 @@
next->coder->lz.code = NULL;
next->coder->lz.end = NULL;
// mf.size is initialized to silence Valgrind
// when used on optimized binaries (GCC may reorder
// code in a way that Valgrind gets unhappy).
next->coder->mf.buffer = NULL;
......@@ -544,4 +547,5 @@
next->coder->mf.buffer = NULL;
next->coder->mf.size = 0;
next->coder->mf.hash = NULL;
next->coder->mf.son = NULL;
next->coder->mf.hash_count = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment