fuzz: enable passing a max value to FuzzedDataProvider::ConsumeEnum() #21855

pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:ConsumeEnum-enable-passing-max-value changing 1 files +5 −6
  1. jonatack commented at 5:10 PM on May 4, 2021: member

    FuzzedDataProvider::ConsumeEnum(), last updated in e3d2ba7c70b13a2165020e45abf02373a1e953f7 remains unused in the codebase as it requires the presence of a |kMaxValue| in the enum aliased to the largest value to be fuzzed, e.g. enum class Foo { SomeValue, OtherValue, kMaxValue = OtherValue }. It seems unlikely that we'll change the enums in the codebase for this. To make ConsumeEnum useable for us, change it to allow passing the max_value to be fuzzed in the contiguous range of {0..max_value}.

  2. fuzz: enable passing a max value to FuzzedDataProvider::ConsumeEnum() 26e30b8dd2
  3. jonatack commented at 5:20 PM on May 4, 2021: member

    Extracted from 6902abc804f3a96292050c63b9cad25ff628bef7 in #21843 which augments rather than replaces ConsumeEnum(), commit to be dropped there if merged here.

  4. DrahtBot added the label Tests on May 4, 2021
  5. practicalswift commented at 6:52 PM on May 4, 2021: contributor

    Concept ACK

    Historically we've kept FuzzedDataProvider.h in sync with upstream (LLVM's FuzzedDataProvider.h) without any local modifications.

    If we cannot upstream those changes then perhaps a helper can be added to the local src/test/fuzz/util.h? :)

  6. jonatack commented at 6:56 PM on May 4, 2021: member

    @practicalswift That makes sense, thanks for the perspective. I'll look at doing that.

  7. DrahtBot commented at 12:14 AM on May 5, 2021: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #21843 (p2p, rpc: enable GetAddr, GetAddresses, and getnodeaddresses by network by jonatack)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. jonatack commented at 11:15 AM on May 5, 2021: member

    Closing for now.

  9. jonatack closed this on May 5, 2021

  10. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me