h5repack: fix silent loss of a declared cd_nelmts for UD filters#6466
Open
brtnfld wants to merge 2 commits into
Open
h5repack: fix silent loss of a declared cd_nelmts for UD filters#6466brtnfld wants to merge 2 commits into
brtnfld wants to merge 2 commits into
Conversation
Contributor
Review ChecklistThis PR touches the following areas. Each needs a sign-off
|
A declared cd_nelmts with no values following it (e.g. UD=<filtn>,<flag>,1) was never committed to filt->cd_nelmts: the trailing token (no comma after it) was always treated as a value, never checked against the l/f/p pending flags the way the comma-triggered branch does. h5repack's own validation then silently passed since cd_nelmts stayed at its default 0, and the mismatch was only ever caught by coincidence when the underlying filter plugin did its own internal cd_values check (issue HDFGroup#6462). Commit the trailing token to whichever UD field is still pending, mirroring the comma-triggered branch exactly.
12bdd80 to
f750e26
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #6462.
A declared
cd_nelmtswith no values following it (e.g.UD=<filtn>,<flag>,1) was never committed tofilt->cd_nelmtsinparse_filter(): the trailing token (the one with no comma after it) was always treated as a value, never checked against thel/f/ppending flags the way the comma-triggered branch already does.h5repack's own "incorrect number of compression parameters" validation then silently passed, sincefilt->cd_nelmtsstayed at itsmemsetdefault of0regardless of what the user actually wrote. The mismatch was only ever caught by coincidence, when the underlying filter plugin happened to do its own internalcd_valuescount check (see discussion on #6434).filtn/filt_flag/cd_nelmts/value) is still pending, mirroring the comma-triggered branch.l/f/pat declaration to clear a real-Wmaybe-uninitializedwarning the change exposed (the compiler can't otherwise prove the UD branch that sets them was taken).plugin_test_nelmts_no_values,UD=250,0,1) using filter 250, which has no internal validation, so the parser's own check is what's actually being exercised — the existingplugin_test_lesstest (UD=257,0,1) passed for the wrong reason (filter 257's internal check, notparse_filter()'s), and still does, but now for the right reason too.