Skip to content

Commit

Permalink
deps: fix CLEAR_HASH macro to be usable as a single statement
Browse files Browse the repository at this point in the history
Apply unreleased (as of zlib v1.2.11) patch from upstream:
- madler/zlib@38e8ce3

Original commit message:
  Fix CLEAR_HASH macro to be usable as a single statement.

  As it is used in deflateParams().

PR-URL: #11616
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
sam-github authored and evanlucas committed Mar 7, 2017
1 parent 3b27b8d commit ed6d741
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deps/zlib/deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,11 @@ local const config configuration_table[10] = {
* prev[] will be initialized on the fly.
*/
#define CLEAR_HASH(s) \
s->head[s->hash_size-1] = NIL; \
zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
do { \
s->head[s->hash_size-1] = NIL; \
zmemzero((Bytef *)s->head, \
(unsigned)(s->hash_size-1)*sizeof(*s->head)); \
} while (0)

/* ===========================================================================
* Slide the hash table when sliding the window down (could be avoided with 32
Expand Down

0 comments on commit ed6d741

Please sign in to comment.