enum types track whether they've had values added via "redef"

This commit is contained in:
Vern Paxson 2021-04-01 18:38:58 -07:00
parent 45004872e8
commit 341c284de9
2 changed files with 9 additions and 0 deletions

View file

@ -1341,6 +1341,9 @@ void EnumType::CheckAndAddName(const string& module_name, const char* name,
bro_int_t val, bool is_export, detail::Expr* deprecation,
bool from_redef)
{
if ( from_redef )
has_redefs = true;
if ( Lookup(val) )
{
reporter->Error("enumerator value in enumerated type definition already exists");