Skip to content

Commit

Permalink
EnumConfigParam: Fix invalid assignment (found by UBSan)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghabry committed Nov 20, 2023
1 parent 69aaecd commit c52a8fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config_param.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class EnumConfigParam : public ConfigParamBase<E> {
EnumConfigParam(StringView name, StringView description, StringView config_section, StringView config_key, E value, std::array<StringView, S> values, std::array<StringView, S> tags, std::array<StringView, S> value_descriptions) :
ConfigParamBase<E>(name, description, config_section, config_key, value), _values{ values }, _tags{ tags}, _value_descriptions{ value_descriptions } {
for (size_t i = 0; i < S; ++i) {
_valid[static_cast<E>(S)] = true;
_valid[static_cast<E>(i)] = true;
}
}

Expand Down Expand Up @@ -425,7 +425,7 @@ class EnumConfigParam : public ConfigParamBase<E> {
}

private:
lcf::FlagSet<E> _valid = ~lcf::FlagSet<E>();
lcf::FlagSet<E> _valid;
std::array<StringView, S> _values;
std::array<StringView, S> _tags;
std::array<StringView, S> _value_descriptions;
Expand Down

0 comments on commit c52a8fd

Please sign in to comment.