From 073225cb01d9c2629c7a423dbe6afcd07601ffb7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 28 Apr 2016 13:35:16 +0200 Subject: [PATCH] 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. --- src/chain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chain.h b/src/chain.h index 5b9605a80b..017d4fe457 100644 --- a/src/chain.h +++ b/src/chain.h @@ -54,7 +54,7 @@ struct CDiskBlockPos }; -enum BlockStatus { +enum BlockStatus: uint32_t { //! Unused. BLOCK_VALID_UNKNOWN = 0,