Browse Source

chain: define enum used as bit field as uint32_t

Bitwise logic combined with `<` with undefined signedness will
potentially results in undefined behavior. Fix this by defining the type
as a c++11 typed enum.

Fixes #6017.
pull/4/head
Wladimir J. van der Laan 8 years ago
committed by Jack Grigg
parent
commit
0e2b1ae259
No known key found for this signature in database GPG Key ID: 6A6914DAFBEA00DA
  1. 2
      src/chain.h

2
src/chain.h

@ -56,7 +56,7 @@ struct CDiskBlockPos
};
enum BlockStatus {
enum BlockStatus: uint32_t {
//! Unused.
BLOCK_VALID_UNKNOWN = 0,

Loading…
Cancel
Save