Avoid left shift of a negative value in flush rank calculation.
The C standard permits an undefined result for a left shift of a negative value.
This commit is contained in:
@@ -156,7 +156,7 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
|
/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
|
||||||
#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0))
|
#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
|
||||||
|
|
||||||
/* ===========================================================================
|
/* ===========================================================================
|
||||||
* Update a hash value with the given input byte
|
* Update a hash value with the given input byte
|
||||||
|
|||||||
Reference in New Issue
Block a user