-
-
Notifications
You must be signed in to change notification settings - Fork 308
Misc inflate cleanup #1797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc inflate cleanup #1797
Conversation
WalkthroughThe changes involve modifications to the inflation process within the compression library. Key updates include conditional initialization of state variables based on compilation flags, restructuring of the Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
x86-64 (i9-9900K) 2.2.2x86-64 Inflate cleanup PRRpi5b 2.2.2Rpi5b Inflate cleanup PRTLDR; Aarch64 deflatebench: 2.83% speedup (Probably just hit a sweet-spot and not reliable) All in all it seems likely to be a minor speedup along with a slight reduction of codesize. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1797 +/- ##
===========================================
+ Coverage 33.18% 33.27% +0.09%
===========================================
Files 66 66
Lines 5490 5481 -9
Branches 1225 1222 -3
===========================================
+ Hits 1822 1824 +2
Misses 3407 3407
+ Partials 261 250 -11 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🧹 Outside diff range and nitpick comments (2)
inflate.h (2)
108-108: Consider renaming thewasvariable for clarityThe variable
wasmay not be immediately descriptive. Consider renaming it to something more meaningful likeinitial_match_lengthto improve code readability.
112-112: Clarify the comment for thebackvariableThe comment
bits back of last unprocessed length/litcould be clearer. Rewriting it asNumber of bits of the last unprocessed length/literal codemay enhance understanding.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
- infback.c (1 hunks)
- inffast_tpl.h (4 hunks)
- inflate.c (6 hunks)
- inflate.h (1 hunks)
🔇 Additional comments not posted (17)
infback.c (4)
58-58: LGTM: Addition ofwsize_realfieldThe new
wsize_realfield is a good addition. It allows for accurate tracking of the actual window buffer size, including any padding, which aligns with the PR objectives. Initializing it with the same value aswsizeis correct for the initial state.
63-65: LGTM: Conditional compilation fordmaxThe conditional compilation for
dmaxis a good optimization. It ensures thatdmaxis only set whenINFLATE_STRICTis defined, which aligns with the PR objectives. This change can potentially reduce unnecessary updates in non-strict inflation scenarios, improving performance.The value 32768U (2^15) is appropriate as it's the maximum distance value in the DEFLATE specification.
58-68: LGTM: EnhancedinflateBackInitfunctionThe changes to the
inflateBackInitfunction successfully implement the PR objectives:
- Addition of
wsize_realfor accurate window buffer size tracking.- Conditional setting of
dmaxbased onINFLATE_STRICT.- Conditional setting of
sanebased onINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR.These modifications allow for more flexible configurations and potentially improved performance by avoiding unnecessary updates. The changes are well-integrated into the existing function structure without introducing any apparent issues.
58-68: Summary: Successful enhancement ofinflateBackInitThe changes to
infback.csuccessfully implement the PR objectives by enhancing theinflate_statestructure. The addition ofwsize_realand the conditional compilation fordmaxandsaneallow for more accurate tracking and flexible configurations. These modifications should improve the inflation process and potentially enhance performance.The code changes are well-integrated and don't introduce any apparent issues. However, a clarification on the purpose of the
INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRRdirective would be beneficial for maintainability.Overall, these changes represent a solid improvement to the zlib-ng library's inflation process.
inflate.h (6)
100-100: LGTM: Addition of 'strm' pointer in state structureThe addition of
PREFIX3(stream) *strm;to theinflate_statestructure is appropriate and enhances state management.
155-156: Approve conditional inclusion ofdmaxvariableThe inclusion of
unsigned dmax;under#ifdef INFLATE_STRICTis appropriate. Ensure that all references todmaxare also conditionally compiled.
143-145: Validate architecture-specific padding implementationConfirm that the added padding for
_M_IX86and_M_ARMarchitectures meets the alignment requirements and does not introduce unintended side effects.Run the following script to ensure correct implementation:
#!/bin/bash # Description: Check the padding implementation for specific architectures # Test: Examine the definitions related to padding rg --type c -A 2 -B 2 'padding\[2\]'
121-121: Confirm the appropriate usage ofchunksizeEnsure that the
chunksizevariable is properly set and utilized in memory copying operations to optimize performance without introducing errors.Run the following script to find and review usages:
#!/bin/bash # Description: Find all usages of 'chunksize' in the codebase # Test: Verify that 'chunksize' is used correctly rg --type c 'chunksize'
158-159: Verify logic associated with thesanevariableUnder
#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR, ensure that theint sane;variable correctly controls the allowance of invalid distances during inflation.Run the following script to check the usage:
#!/bin/bash # Description: Verify the implementation and usage of 'sane' # Test: Find all code sections that reference 'sane' rg --type c 'sane'
117-117: Verify proper initialization and usage ofwsize_realEnsure that
wsize_realis correctly initialized and consistently used throughout the codebase to account for the actual window buffer size, including padding.Run the following script to check the initialization and usage:
✅ Verification successful
Initialization and Usage of
wsize_realVerifiedThe variable
wsize_realis correctly initialized and consistently used across the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify initialization and usage of 'wsize_real' # Test: Search for all references to 'wsize_real' rg --type c 'wsize_real'Length of output: 415
Script:
#!/bin/bash # Description: Re-verify initialization and usage of 'wsize_real' with corrected commands # Test 1: Search for all references to 'wsize_real' rg --type c 'wsize_real' # Test 2: Search for patterns related to 'padding' that might affect 'wsize_real' initialization rg --type c 'padding\[2\]'Length of output: 486
inffast_tpl.h (4)
140-140: Verify the use ofstate->wsize_realinextra_safecalculationThe condition for
extra_safenow usesstate->wsize_realinstead ofstate->wsize. Ensure thatstate->wsize_realaccurately represents the actual size of the window buffer including any padding. This change affects the memory safety checks and could impact buffer boundary validations.
190-192: Confirm the direct use ofstate->dmaxfor distance validationThe code now directly accesses
state->dmaxinstead of using a localdmaxvariable. Verify thatstate->dmaxis correctly initialized and accessible at this point in the code, especially whenINFLATE_STRICTis defined. This ensures that distance checks function as intended without introducing errors.
Line range hint
201-223: Review the logic withinINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRRblockThe modified code introduces additional conditions when
state->saneis true and handles cases where the distance is too far back by either setting an error or filling with zeros. Please consider:
- Ensuring that the condition
if (state->sane)aligns with the intended behavior of strict mode.- Verifying that the loops and conditions correctly handle edge cases without causing infinite loops or unintended side effects.
- Checking that the fall-through logic correctly progresses to the next operation when appropriate.
223-225: Approve the error handling for invalid distances when strict mode is not allowedIn the
#elseblock corresponding toINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR, the code appropriately sets an error when an invalid distance is encountered and breaks out of the loop. This ensures consistent behavior when the strict mode is not permitted.inflate.c (3)
243-243: Addition of 'state->wsize_real'The new variable
state->wsize_realis introduced and initialized correctly withINFLATE_ADJUST_WINDOW_SIZE((1 << MAX_WBITS) + 64). This enhancement tracks the actual size of the window buffer, including any padding, which can improve the usage within the chunkset code.
Line range hint
1059-1078: Conditional handling of 'invalid distance too far back' errorThe code now conditionally handles the "invalid distance too far back" error based on the
INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRRmacro. This change provides flexibility, allowing the library to either enforce strict distance checks or permit certain invalid distances based on compilation flags.
1416-1421: Conditional behavior in 'inflateUndermine' functionIn the
inflateUnderminefunction, the behavior is now contingent on theINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRRmacro. When the macro is defined,state->saneis set based on thesubvertparameter; otherwise, the function returnsZ_DATA_ERROR. This ensures that the function's behavior aligns with the configured inflation policy.
|
PS: Betatesting coderabbitai, so far it does not seem too intelligent when it comes to these changes 😆 |
|
MSVC CI is failing due to warning C4324 (struct padded due to alignment). I don't really think that warning (especially as an error) provides us any benefit at all. The fact that the end of a struct is padded up to the next cacheline boundary is pretty much a non-issue. @mtl1979 Perhaps we should just disable that warning entirely? It would end up failing if someone compiles with optional features anyway, and it also makes it harder to maintain since not everyone has access to MSVC. |
b996bc8 to
3f00a03
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
inffast_tpl.h (1)
Incomplete Removal of Validation Macros
The following files still contain references to the removed macros
INFLATE_STRICTandINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR:
inflate.hinffast_tpl.hinflate.cinfback.ctest/infcover.cPlease ensure that all instances of these macros are fully removed to maintain code consistency and prevent potential issues.
🔗 Analysis chain
Line range hint
190-225: Simplified distance validation logicThe changes streamline the distance validation process by:
- Removing the
INFLATE_STRICTconditional compilation.- Eliminating the complex
INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRRerror handling.- Introducing a simpler error handling mechanism for invalid distances.
These modifications simplify the code and potentially improve performance. However, we should ensure that this doesn't compromise the robustness of the inflation process.
To verify the impact of these changes, please run the following script:
This script will help ensure that the changes are consistent across the codebase and that distance handling is uniform.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining references to removed macros and validate distance handling # Test 1: Check for any remaining references to removed macros echo "Checking for removed macro references:" rg --type c "INFLATE_STRICT|INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR" . # Test 2: Analyze distance handling in other parts of the codebase echo "Analyzing distance handling:" ast-grep --lang c --pattern 'if ($_ > state->dmax) { $$ }'Length of output: 1136
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
- infback.c (1 hunks)
- inffast_tpl.h (4 hunks)
- inflate.c (6 hunks)
- inflate.h (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- infback.c
- inflate.c
- inflate.h
🧰 Additional context used
📓 Learnings (1)
📓 Common learnings
Learnt from: Dead2 PR: zlib-ng/zlib-ng#1797 File: inflate.h:127-130 Timestamp: 2024-09-25T16:24:41.405Z Learning: In the `inflate_state` structure, fields like `lenbits`, `lencode`, `distcode`, and `distbits` may be moved within the structure for optimization purposes; they are not necessarily new additions.
🔇 Additional comments not posted (2)
inffast_tpl.h (2)
140-140: Improved safety check for window buffer overlapThis new condition enhances the safety of chunk copy operations by detecting when the output buffer overlaps with the window buffer. The use of
state->wsize_realaccounts for potential padding in the window buffer, providing a more accurate boundary check.
Line range hint
1-359: Overall assessment of changesThe modifications in this file align well with the PR objectives:
- The introduction of
extra_safeimproves the safety of chunk copy operations by accurately detecting window buffer overlaps.- The simplification of distance validation logic streamlines the code and potentially improves performance.
- The removal of complex conditional compilation directives and error handling makes the code more maintainable.
These changes contribute to a more efficient and robust inflation process. However, it's crucial to ensure that these modifications don't introduce any regressions in edge cases or compromise the library's ability to handle malformed input.
To ensure the changes don't introduce any regressions, please run the existing test suite with a focus on:
- Edge cases for distance handling
- Performance benchmarks for inflation operations
- Handling of malformed input
Additionally, consider adding new test cases that specifically target the modified logic to ensure its correctness and robustness.
3f00a03 to
79fe094
Compare
Some warnings are safe to disable, disabling others can cause crashes or poor performance... We have line in CMakeLists.txt that disables useless warnings. |
Yeah, I meant to add a commit that disables that warning here, but instead I managed to push it directly into Develop. Can't force-push without it, so I think we'll just keep it rather than revert it and add it back by PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvements and nice code size reduction.
KungFuJesus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…allow the chunkset code to spill garbage data into the padding area if available.
needed by inffast (from 6 cachelines to 1). Also fill in some unnecessary holes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
- infback.c (1 hunks)
- inffast_tpl.h (4 hunks)
- inflate.c (6 hunks)
- inflate.h (1 hunks)
🧰 Additional context used
📓 Learnings (3)
📓 Common learnings
Learnt from: Dead2 PR: zlib-ng/zlib-ng#1797 File: inflate.h:127-130 Timestamp: 2024-09-25T16:24:41.405Z Learning: In the `inflate_state` structure, fields like `lenbits`, `lencode`, `distcode`, and `distbits` may be moved within the structure for optimization purposes; they are not necessarily new additions.inflate.c (2)
Learnt from: Dead2 PR: zlib-ng/zlib-ng#1797 File: inflate.c:81-83 Timestamp: 2024-09-25T16:25:56.686Z Learning: When `INFLATE_STRICT` is not defined, the variable `state->dmax` is completely removed from the code.Learnt from: Dead2 PR: zlib-ng/zlib-ng#1797 File: inflate.c:84-86 Timestamp: 2024-09-25T16:26:23.643Z Learning: When `INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR` is not defined, `state->sane` is completely removed from the codebase and does not need to be initialized.inflate.h (1)
Learnt from: Dead2 PR: zlib-ng/zlib-ng#1797 File: inflate.h:127-130 Timestamp: 2024-09-25T16:24:41.405Z Learning: In the `inflate_state` structure, fields like `lenbits`, `lencode`, `distcode`, and `distbits` may be moved within the structure for optimization purposes; they are not necessarily new additions.
🔇 Additional comments (12)
inflate.h (3)
127-130: No action needed on code table fieldsBased on previous discussions, I recognize that the fields
lenbits,lencode,distcode, anddistbitshave been moved within theinflate_statestructure for optimization purposes and are not new additions. No further action is needed.
117-117: Ensurewbufsizeis correctly handledThe
wbufsizefield has been added to represent the real size of the allocated window buffer, including any padding. Verify thatwbufsizeis correctly set during window buffer allocation and that any calculations or operations involving the window buffer correctly usewbufsizewhere appropriate.To verify, you can run the following script:
#!/bin/bash # Description: Check initialization and usage of `wbufsize` # Search for initialization of `wbufsize` rg --type c --type h -A 3 -B 3 'wbufsize\s*=' # Search for usage of `wbufsize` rg --type c --type h 'wbufsize'
154-159: Confirm conditional compilation ofdmaxandsaneThe variables
dmaxandsaneare now conditionally compiled underINFLATE_STRICTandINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR, respectively. Ensure that all references to these variables in the code are also properly guarded with the same conditional compilation checks to prevent any compilation errors or unintended behavior when these flags are not defined.To check the conditional usage of
dmaxandsane, you can run:#!/bin/bash # Description: Verify that `dmax` and `sane` are conditionally used. # Check for uses of `dmax` outside of `#ifdef INFLATE_STRICT` guards rg --type c --type h 'dmax' -g '!*inflate.h' | rg -v '#ifdef INFLATE_STRICT' -B 5 -A 5 # Check for uses of `sane` outside of `#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR` guards rg --type c --type h 'sane' -g '!*inflate.h' | rg -v '#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR' -B 5 -A 5inffast_tpl.h (3)
140-140: Update to 'extra_safe' calculation enhances buffer safetyThe change from
wsizetostate->wbufsizein theextra_safeassignment ensures that the buffer size includes any padding in the window buffer. This adjustment allows the chunkset code to safely utilize the padding area during decompression, preventing potential out-of-bounds memory access.
190-190: Consistent use of 'state->dmax' for distance validationReplacing
dmaxwithstate->dmaxin the distance check directly references thedmaxvalue from the current inflate state. This change improves consistency and clarity by ensuring that distance validations are based on the active state parameters.
Line range hint
201-225: Improved error handling for invalid distances in conditional compilationWithin the
#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRRblock, the updated code now checksstate->sanebefore setting the error state. This allows for more nuanced error handling based on thesaneflag, providing flexibility for different compilation configurations and enhancing robustness in handling invalid distances during inflation.infback.c (2)
58-68: Ensure consistent conditional compilation blocksBoth
state->dmaxandstate->saneare now conditionally initialized within their respective#ifdefblocks. Ensure that any usage of these variables is also appropriately guarded or that default values are assigned when the conditions are not met to prevent any unintended behavior.You might want to verify that
state->saneis not used whenINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRRis not defined. You can use the following script:#!/bin/bash # Description: Check for usage of 'state->sane' outside '#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR' blocks. # Find all occurrences of 'state->sane' not within INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR guards. rg --type c --no-heading --line-number "state->sane" | while read -r line; do file=$(echo "$line" | cut -d':' -f1) linenum=$(echo "$line" | cut -d':' -f2) # Check if the line is within INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR guards if ! awk "NR==$linenum {print f}{f} /#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR/ {f=1} /#endif/ {f=0}" "$file" | grep -q 'state->sane'; then echo "$line" fi doneThis will help ensure that
state->saneis not accessed unintentionally when it's not initialized.
63-65: 💡 Codebase verification
⚠️ Potential issuePotential Uninitialized Use of
state->dmaxDetectedThe variable
state->dmaxis assigned outside of#ifdef INFLATE_STRICTblocks in the following locations:
infback.c:64inflate.c:82inflate.c:548inflate.c:1042This indicates that
state->dmaxmay remain uninitialized whenINFLATE_STRICTis not defined, potentially leading to undefined behavior.🔗 Analysis chain
Potential uninitialized use of
state->dmaxBy moving the initialization of
state->dmaxinside the#ifdef INFLATE_STRICTblock, there's a risk thatstate->dmaxmay remain uninitialized whenINFLATE_STRICTis not defined. Ifstate->dmaxis accessed elsewhere without this definition, it could lead to undefined behavior. Please ensure thatstate->dmaxis either conditionally used or properly initialized in all configurations.To verify the usage of
state->dmaxoutside of theINFLATE_STRICTconditions, you can run the following script:This script will list occurrences of
state->dmaxthat are outside of#ifdef INFLATE_STRICTblocks.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for usage of 'state->dmax' outside '#ifdef INFLATE_STRICT' blocks. # Find all occurrences of 'state->dmax' not within 'INFLATE_STRICT' blocks. rg --type c --no-heading --line-number "state->dmax" | while read -r line; do file=$(echo "$line" | cut -d':' -f1) linenum=$(echo "$line" | cut -d':' -f2) # Check if the line is within INFLATE_STRICT guards if ! awk "NR==$linenum {print f}{f} /#ifdef INFLATE_STRICT/ {f=1} /#endif/ {f=0}" "$file" | grep -q 'state->dmax'; then echo "$line" fi doneLength of output: 2186
Script:
#!/bin/bash # Description: Check for usage of 'state->dmax' outside '#ifdef INFLATE_STRICT' blocks. # Find all occurrences of 'state->dmax' in C files rg --type c --no-heading --line-number "state->dmax" | while read -r line; do file=$(echo "$line" | cut -d':' -f1) linenum=$(echo "$line" | cut -d':' -f2) # Check if the line is within INFLATE_STRICT guards context=$(sed -n "$linenum p" "$file") before=$(sed -n "1,$((linenum-1)) p" "$file") # Determine if the 'state->dmax' line is inside an #ifdef INFLATE_STRICT block is_within_ifdef=$(echo "$before" | grep -B1 '#ifdef INFLATE_STRICT' | grep '#endif' | wc -l) if [ "$is_within_ifdef" -eq 0 ]; then echo "$line" fi doneLength of output: 146816
⛔ Skipped due to learnings
Learnt from: Dead2 PR: zlib-ng/zlib-ng#1797 File: inflate.c:81-83 Timestamp: 2024-09-25T16:25:56.686Z Learning: When `INFLATE_STRICT` is not defined, the variable `state->dmax` is completely removed from the code.inflate.c (4)
243-243: Consistent window buffer size initializationThe assignment to
state->wbufsizeensures that the window buffer size is consistently calculated with the necessary padding. This change alignsstate->wbufsizewith the adjusted window size, including the 64-byte padding for chunk size.
1416-1429: Conditional compilation ininflateUnderminefunctionThe
inflateUnderminefunction now conditionally compiles its logic based onINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR. The implementation correctly handles both cases:
- When
INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRRis defined, it updatesstate->sane.- When not defined, it returns
Z_DATA_ERROR, indicating the operation is not permitted.
Line range hint
1059-1078: Ensurestate->saneis consistently guardedThe code introduces conditional handling based on
INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR. Please verify that all occurrences ofstate->saneare properly enclosed within#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRRto avoid referencing it when the macro is not defined.Run the following script to identify any unguarded usages:
#!/bin/bash # Description: Find usages of 'state->sane' not guarded by 'INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR' # Search for 'state->sane' in the codebase, excluding lines within '#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR' blocks rg 'state->sane' --type-add 'c_ext:*.{c,h}' --type c_ext --vimgrep | grep -v 'INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR'
547-549: Verify all usages ofstate->dmaxare conditionally compiledThe initialization of
state->dmaxis enclosed within#ifdef INFLATE_STRICT. Please verify that all references tostate->dmaxin the codebase are also guarded by#ifdef INFLATE_STRICTto prevent any potential usage whenINFLATE_STRICTis not defined.Run the following script to check for unguarded usages:
Also fills in some unnecessary holes.
On x86-64, default settings, inflate_state also shrinks from 9216 to 9152 bytes and now ends cleanly on a cacheline boundary.