RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

sys/event: add assertion that event has a handler

Open benpicco opened this issue 1 year ago • 1 comments

Contribution description

When an uninitialized event is added, we will dereference a NULL pointer. It can then be a bit tricky to find out which event caused this - so add an assertion when queuing the event that a callback is set.

Testing procedure

Issues/PRs references

benpicco avatar Aug 29 '24 15:08 benpicco

Murdock results

:heavy_check_mark: PASSED

16c447afb1d1fbb540829aa43159aa235ac2cdcd gcoap: make use of event_callback_post()

Success Failures Total Runtime
10193 0 10193 18m:19s

Artifacts

riot-ci avatar Aug 29 '24 19:08 riot-ci

A callback struct with a NULL handler does no harm in itself. Only when you try to add it to an event queue, things will blow up.

benpicco avatar Oct 24 '24 17:10 benpicco