Emit error for alternate event/hook prototype args with attributes

Argument attributes are only allowed in the canonical prototype.
This commit is contained in:
Jon Siwek 2020-04-09 21:00:09 -07:00
parent 9b6934eab8
commit 070b28ac05
4 changed files with 64 additions and 0 deletions

View file

@ -76,6 +76,13 @@ static bool add_prototype(ID* id, BroType* t, attr_list* attrs,
for ( auto i = 0; i < alt_args->NumFields(); ++i )
{
auto field = alt_args->FieldName(i);
if ( alt_args->FieldDecl(i)->attrs )
{
alt_ft->Error(fmt("alternate function prototype arguments may not have attributes: arg '%s'", field), canon_ft);
return false;
}
auto o = canon_args->FieldOffset(field);
if ( o < 0 )