removed dead assignment of "bits" var #801

pull whb07 wants to merge 1 commits into bitcoin-core:master from whb07:fix_dead_store changing 1 files +0 −1
  1. whb07 commented at 9:40 PM on August 20, 2020: contributor

    Toying around with Clang's "scan-build" static analyzer and found this dead assignment. If its meant to be a "zero out", the C/C++ specs state its up to the compiler to decide what to do with it. So by observing the "bits = 0" does nothing, it will just remove it from output.

    The bits is removed as the function is about to return.

    Tests passing. Below is screenshot of scan-build logging the error: Screen Shot 2020-08-20 at 5 37 59 PM

  2. removed dead assignment of "bits" var b9c5e373ab
  3. real-or-random commented at 10:28 PM on August 20, 2020: contributor

    Thanks! That's indeed a dead store and it's meant as a zero-out but of course it doesn't work. This will be fixed by https://github.com/bitcoin-core/secp256k1/pull/636/files#diff-9d23f46e6342836fd7b34eaac40b4ada as soon as rebase this (hopefully soon). Until then, I'd personally to prefer to keep this line as a reminder unless there is another good reason to remove it.

  4. whb07 commented at 10:34 PM on August 20, 2020: contributor

    Oooh nice, I didn’t catch that PR yep sounds good. 👌

  5. whb07 closed this on Aug 20, 2020


github-metadata-mirror

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

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