diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2017-02-28 10:46:29 -0800 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2017-03-06 09:37:17 -0800 |
commit | fd17e8b8d250492fdcabbc8b7a3bf57687ae364a (patch) | |
tree | f685dbddfc3948aaa3ebe2793a63220ede65fe26 /deps/zlib/deflate.c | |
parent | 75cdc895ec8fd38b3a22535d9f90792c7c7be964 (diff) | |
download | android-node-v8-fd17e8b8d250492fdcabbc8b7a3bf57687ae364a.tar.gz android-node-v8-fd17e8b8d250492fdcabbc8b7a3bf57687ae364a.tar.bz2 android-node-v8-fd17e8b8d250492fdcabbc8b7a3bf57687ae364a.zip |
deps: fix CLEAR_HASH macro to be usable as a single statement
Apply unreleased (as of zlib v1.2.11) patch from upstream:
- https://github.com/madler/zlib/commit/38e8ce32afbaa82f67d992b9f3056f281fe69259
Original commit message:
Fix CLEAR_HASH macro to be usable as a single statement.
As it is used in deflateParams().
PR-URL: https://github.com/nodejs/node/pull/11616
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/zlib/deflate.c')
-rw-r--r-- | deps/zlib/deflate.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/deps/zlib/deflate.c b/deps/zlib/deflate.c index 1ec761448d..909606df01 100644 --- a/deps/zlib/deflate.c +++ b/deps/zlib/deflate.c @@ -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 |