mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
GH-1534: Fix excessive coredump for duplicate enum definitions
An adequate error message was previously reported for duplicate enum definitions, this just now prevents trying to access it as a constant in subsequent parsing and further generating a coredump.
This commit is contained in:
parent
af3814792a
commit
13f3cb377f
3 changed files with 15 additions and 0 deletions
|
@ -769,6 +769,13 @@ expr:
|
|||
|
||||
else if ( id->IsEnumConst() )
|
||||
{
|
||||
if ( IsErrorType(id->GetType()->Tag()) )
|
||||
{
|
||||
// The most-relevant error message should already be reported, so
|
||||
// just bail out.
|
||||
YYERROR;
|
||||
}
|
||||
|
||||
EnumType* t = id->GetType()->AsEnumType();
|
||||
auto intval = t->Lookup(id->ModuleName(), id->Name());
|
||||
if ( intval < 0 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue