Skip to content

Commit

Permalink
chain: define enum used as bit field as uint32_t
Browse files Browse the repository at this point in the history
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 zcash#6017.
  • Loading branch information
laanwj authored and str4d committed Mar 23, 2017
1 parent 599d2c4 commit 0e2b1ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct CDiskBlockPos

};

enum BlockStatus {
enum BlockStatus: uint32_t {
//! Unused.
BLOCK_VALID_UNKNOWN = 0,

Expand Down

0 comments on commit 0e2b1ae

Please sign in to comment.