mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix return value of hook calls that have no handlers.
For this case, the return value is always true.
This commit is contained in:
parent
4a09c12882
commit
98663fd534
2 changed files with 2 additions and 1 deletions
|
@ -288,7 +288,7 @@ Val* BroFunc::Call(val_list* args, Frame* parent) const
|
||||||
assert(Flavor() == FUNC_FLAVOR_EVENT || Flavor() == FUNC_FLAVOR_HOOK);
|
assert(Flavor() == FUNC_FLAVOR_EVENT || Flavor() == FUNC_FLAVOR_HOOK);
|
||||||
loop_over_list(*args, i)
|
loop_over_list(*args, i)
|
||||||
Unref((*args)[i]);
|
Unref((*args)[i]);
|
||||||
return 0 ;
|
return Flavor() == FUNC_FLAVOR_HOOK ? new Val(true, TYPE_BOOL) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SegmentProfiler(segment_logger, location);
|
SegmentProfiler(segment_logger, location);
|
||||||
|
|
|
@ -3,6 +3,7 @@ myhook return F
|
||||||
myhook return T
|
myhook return T
|
||||||
myhook, &priority=5, [a=37, b=goobye world]
|
myhook, &priority=5, [a=37, b=goobye world]
|
||||||
F
|
F
|
||||||
|
T
|
||||||
myhook3, 8
|
myhook3, 8
|
||||||
T
|
T
|
||||||
myhook4, 2
|
myhook4, 2
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue