Skip to content

Commit 0a1ff59

Browse files
sam-githubMylesBorins
authored andcommitted
deps: fix CLEAR_HASH macro to be usable as a single statement
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]>
1 parent 2010f43 commit 0a1ff59

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

deps/zlib/deflate.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,11 @@ local const config configuration_table[10] = {
190190
* prev[] will be initialized on the fly.
191191
*/
192192
#define CLEAR_HASH(s) \
193-
s->head[s->hash_size-1] = NIL; \
194-
zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
193+
do { \
194+
s->head[s->hash_size-1] = NIL; \
195+
zmemzero((Bytef *)s->head, \
196+
(unsigned)(s->hash_size-1)*sizeof(*s->head)); \
197+
} while (0)
195198

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

0 commit comments

Comments
 (0)