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 <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
sam-github authored and MylesBorins committed Mar 29, 2017
1 parent 2e52a26 commit 253980f
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 253980f

Please sign in to comment.