-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sys/event: add assertion that event has a handler #20847
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, would you mind reminding me if I have not come around for a proper review in a couple weeks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Any specific reason you omitted an assert(cb)
in callback.c event_callback_init(..)
?
A callback struct with a NULL handler does no harm in itself. |
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