Merge remote-tracking branch 'origin/topic/jsiwek/alternate-hook-event-prototypes'

* origin/topic/jsiwek/alternate-hook-event-prototypes:
  Add warning for ineffective &default arguments in handlers
  Fix frame size allocation of alternate event/hook handlers
  Emit error for alternate event/hook prototype args with attributes
  Improve alternate event/hook prototype matching
  Allow alternate event/hook prototype declarations
This commit is contained in:
Tim Wojtulewicz 2020-04-13 14:59:50 -07:00
commit ba1c03188f
24 changed files with 715 additions and 16 deletions

View file

@ -449,6 +449,11 @@ void BroFunc::AddBody(IntrusivePtr<Stmt> new_body, id_list* new_inits,
if ( new_frame_size > frame_size )
frame_size = new_frame_size;
auto num_args = FType()->Args()->NumFields();
if ( num_args > static_cast<int>(frame_size) )
frame_size = num_args;
new_body = AddInits(std::move(new_body), new_inits);
if ( Flavor() == FUNC_FLAVOR_FUNCTION )