Add error message for bad enum declaration syntax.

BIT-1273 #close
This commit is contained in:
Jon Siwek 2014-10-15 10:20:47 -05:00
parent 191e5da74d
commit ccc88beeee
3 changed files with 11 additions and 2 deletions

View file

@ -127,7 +127,11 @@ static void parser_new_enum (void)
{
/* Starting a new enum definition. */
assert(cur_enum_type == NULL);
cur_enum_type = new EnumType(cur_decl_type_id->Name());
if ( cur_decl_type_id )
cur_enum_type = new EnumType(cur_decl_type_id->Name());
else
reporter->FatalError("incorrect syntax for enum type declaration");
}
static void parser_redef_enum (ID *id)