diff options
author | Yann Collet <cyan@fb.com> | 2017-09-30 17:35:55 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2017-09-30 17:35:55 (GMT) |
commit | f6b31bf0d082315103d2fb5fc8f2094be567bb63 (patch) | |
tree | 49b07bb8e7912ce929b67bd25bc4b5e3e8f62c09 /lib/lz4frame.c | |
parent | ceb868f4425a547bc5e08b6c80aaf4cc750fc9aa (diff) | |
download | lz4-f6b31bf0d082315103d2fb5fc8f2094be567bb63.zip lz4-f6b31bf0d082315103d2fb5fc8f2094be567bb63.tar.gz lz4-f6b31bf0d082315103d2fb5fc8f2094be567bb63.tar.bz2 |
fix #404
static analyzer `cppcheck` complains about a shift-by-32 on a 32 bits value,
which is an undefined behavior.
However, the flagged code path is never triggered in 32-bits mode,
(actually, it's not even generated if DCE kicks in),
the shift-by-32 is necessarily performed on a 64-bits value.
While it doesn't change anything regarding lz4 code generation, for both 32 and 64 bits mode,
(can be checked by md5sum on the generated binary),
the shift has been rewritten in a way which should please this static analyzer,
since it now pretends to shift by 16 on 32-bits cpu (note : it doesn't matter since the code will not even be generated in this case).
Note : this is a blind fix, the new code has not been tested with cppcheck, because cppcheck only works on Windows.
Other static analyzer, such as scan-build, do not trigger this false positive.
Diffstat (limited to 'lib/lz4frame.c')
0 files changed, 0 insertions, 0 deletions