Merge remote-tracking branch 'origin/fastpath'

* origin/fastpath:
  Fix return value of hook calls that have no handlers.
  Fix to_port() BIF for port strings with a port number of zero.
This commit is contained in:
Robin Sommer 2012-12-20 12:12:19 -08:00
commit 40007d075c
7 changed files with 21 additions and 4 deletions

View file

@ -282,13 +282,14 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
#ifdef PROFILE_BRO_FUNCTIONS
DEBUG_MSG("Function: %s\n", id->Name());
#endif
if ( ! bodies.size() )
if ( ! bodies.size() )
{
// Can only happen for events and hooks.
assert(Flavor() == FUNC_FLAVOR_EVENT || Flavor() == FUNC_FLAVOR_HOOK);
loop_over_list(*args, i)
Unref((*args)[i]);
return 0 ;
return Flavor() == FUNC_FLAVOR_HOOK ? new Val(true, TYPE_BOOL) : 0;
}
SegmentProfiler(segment_logger, location);