diff options
author | Snappy Team <no-reply@google.com> | 2021-10-28 04:39:14 +0000 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2021-11-14 22:09:42 +0000 |
commit | 65dc7b383985eb4f63cd3e752136db8d9b4be8c0 (patch) | |
tree | 791b925fad4067e4d65fe174e0cf063b9e3d5422 | |
parent | fe18b46322727fe4bc6939326ba6bde1e0858b61 (diff) | |
download | snappy-git-65dc7b383985eb4f63cd3e752136db8d9b4be8c0.tar.gz |
Pass by reference the first argument of ExtractLowBytes
to avoid UB of passing uninitialized argument by value.
PiperOrigin-RevId: 406052814
-rw-r--r-- | snappy.cc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -954,7 +954,7 @@ static inline void Report(const char *algorithm, size_t compressed_size, // bool TryFastAppend(const char* ip, size_t available, size_t length, T* op); // }; -static inline uint32_t ExtractLowBytes(uint32_t v, int n) { +static inline uint32_t ExtractLowBytes(const uint32_t& v, int n) { assert(n >= 0); assert(n <= 4); #if SNAPPY_HAVE_BMI2 |