Skip to content

Commit 24e33ab

Browse files
committed
Ensure zeros for non-masked bits
1 parent aaa9e16 commit 24e33ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/libhat/signature.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LIBHAT_EXPORT namespace hat {
2323
constexpr signature_element() noexcept = default;
2424
constexpr signature_element(std::nullopt_t) noexcept {}
2525
constexpr signature_element(const std::byte value) noexcept : value_{value}, mask_{0xFF} {}
26-
constexpr signature_element(const std::byte value, const std::byte mask) noexcept : value_{value}, mask_{mask} {}
26+
constexpr signature_element(const std::byte value, const std::byte mask) noexcept : value_{value & mask}, mask_{mask} {}
2727

2828
constexpr signature_element& operator=(std::nullopt_t) noexcept {
2929
return *this = signature_element{};

0 commit comments

Comments
 (0)