]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
IBM Z: Sync crc_fold with DFLTCC
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 11 Oct 2021 11:22:13 +0000 (13:22 +0200)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 13 Oct 2021 13:39:57 +0000 (15:39 +0200)
Intermediate CRC32 value was moved from strm->adler to
state->crc_fold.

arch/s390/dfltcc_deflate.c

index e3b53ee1316011c133d8f1dd79e79c2a93d471d2..0a65aa7e8e35dcc15d65060389e106497ead9a93 100644 (file)
@@ -210,7 +210,7 @@ again:
         *strm->next_out = (unsigned char)state->bi_buf;
     /* Honor history and check value */
     param->nt = 0;
-    param->cv = state->wrap == 2 ? ZSWAP32(strm->adler) : strm->adler;
+    param->cv = state->wrap == 2 ? ZSWAP32(state->crc_fold.value) : strm->adler;
 
     /* When opening a block, choose a Huffman-Table Type */
     if (!param->bcf) {
@@ -241,7 +241,10 @@ again:
         state->bi_buf = 0; /* Avoid accessing next_out */
     else
         state->bi_buf = *strm->next_out & ((1 << state->bi_valid) - 1);
-    strm->adler = state->wrap == 2 ? ZSWAP32(param->cv) : param->cv;
+    if (state->wrap == 2)
+        state->crc_fold.value = ZSWAP32(param->cv);
+    else
+        strm->adler = param->cv;
 
     /* Unmask the input data */
     strm->avail_in += masked_avail_in;