HomeFreeBSD

Refactor loop in dump_histogram()

Description

Refactor loop in dump_histogram()

The current loop triggers a complaint that we are using an array offset
prior to a range check from cpp/offset-use-before-range-check when we
are actually calculating maximum and minimum values. I was about to file
a false positive report with CodeQL, but after looking at how the code
is structured, I really cannot blame CodeQL for mistaking this for a
range check.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14575

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Mar 6 2023, 2:48 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 8 2023, 9:52 PM
Parents
rG08641d900785: Suppress static analyzer warning in dmu_objset_create_impl_dnstats()
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG37edc7ea9881: Refactor loop in dump_histogram() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Mar 8 2023, 9:52 PM