mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
Emit error for alternate event/hook prototype args with attributes
Argument attributes are only allowed in the canonical prototype.
This commit is contained in:
parent
9b6934eab8
commit
070b28ac05
4 changed files with 64 additions and 0 deletions
|
@ -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 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue