Commit 6c0dd306 for xz
commit 6c0dd306250922b0abe26d78fb479ff9e2c42407
Author: Lasse Collin <lasse.collin@tukaani.org>
Date: Mon Nov 23 18:02:48 2026 +0200
liblzma: Use a temporary variable in hash calculation
diff --git a/src/liblzma/lz/lz_encoder_hash.h b/src/liblzma/lz/lz_encoder_hash.h
index 6d4bf837..8bd6ab53 100644
--- a/src/liblzma/lz/lz_encoder_hash.h
+++ b/src/liblzma/lz/lz_encoder_hash.h
@@ -63,15 +63,15 @@
#define hash_3_calc() \
const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \
const uint32_t hash_2_value = temp & HASH_2_MASK; \
- const uint32_t hash_value \
- = (temp ^ ((uint32_t)(cur[2]) << 8)) & mf->hash_mask
+ const uint32_t temp2 = temp ^ ((uint32_t)(cur[2]) << 8); \
+ const uint32_t hash_value = temp2 & mf->hash_mask
#define hash_4_calc() \
const uint32_t temp = hash_table[cur[0]] ^ cur[1]; \
const uint32_t hash_2_value = temp & HASH_2_MASK; \
- const uint32_t hash_3_value \
- = (temp ^ ((uint32_t)(cur[2]) << 8)) & HASH_3_MASK; \
- const uint32_t hash_value = (temp ^ ((uint32_t)(cur[2]) << 8) \
+ const uint32_t temp2 = temp ^ ((uint32_t)(cur[2]) << 8); \
+ const uint32_t hash_3_value = temp2 & HASH_3_MASK; \
+ const uint32_t hash_value = (temp2 \
^ (hash_table[cur[3]] << 5)) & mf->hash_mask