From a43dbea58f0184dd5a81f684a61c8477679c7579 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 21 May 2025 10:15:49 +0200 Subject: [PATCH] All events are required to have their hook This is quite an obvious requirement but it wasn't enforced properly, leading to unnecessarily tedious debugging when an uninitialized event is improperly enqueued. Now BIRD is going to crash as soon as somebody tries to enqueue such an event, not when trying to execute nothing from a clean context. Would have helped with #238. --- lib/event.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/event.c b/lib/event.c index 79b8eb2cf..d71f81f45 100644 --- a/lib/event.c +++ b/lib/event.c @@ -236,7 +236,9 @@ ev_run(event *e) inline void ev_send(event_list *l, event *e) { + ASSERT_DIE(e->hook); edlog(l, e, NULL, 1, EDL_SEND); + /* Set the target list */ event_list *ol = NULL; if (!atomic_compare_exchange_strong_explicit( -- 2.47.2