initialize variable #233

pull theuni wants to merge 1 commits into bitcoin-core:master from theuni:fix-uninit changing 1 files +1 −0
  1. theuni commented at 9:19 PM on April 3, 2015: contributor

    Without this, clang's static analyzer finds:

    ./src/field_5x52_impl.h:425:24: warning: The left operand of '&' is a garbage value
        r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);
    
  2. initialize variable 6534ee1259
  3. gmaxwell commented at 9:32 PM on April 3, 2015: contributor

    I was kind of lamenting if we should do something about that. GCC -O3 complains too, it's just that it's not smart enough to know that the conditional move will blow it away.

    I measure a 2% slowdown from this (bench sign), but it could be measurement noise. (seems kinda high!)

    ACK for whatever it's worth from my side.

  4. sipa commented at 8:18 AM on April 10, 2015: contributor

    I can't measure any difference when locking my CPU to a single frequency. And I mean that very literally:

    before:

    $ ./bench_sign 
    ecdsa_sign: min 69.9us / avg 69.9us / avg 69.9us
    

    after:

    $ ./bench_sign 
    ecdsa_sign: min 69.9us / avg 69.9us / avg 69.9us
    
  5. sipa merged this on Apr 10, 2015
  6. sipa closed this on Apr 10, 2015

  7. sipa referenced this in commit a0d3b89dd6 on Apr 10, 2015
Contributors

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-27 04:15 UTC

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