Closed plietar closed 9 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
877fa6b
) 96.25% compared to head (85c9afd
) 96.26%. Report is 3 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The
Event::should_trigger
method uses.begin()
on the set of times at which it needs to fire to compare that value with the current tick. However it was missing a check in the case of an empty set. When that happens,begin()
returns a pointer to uninitialized memory and we we reading garbage out of it. If that garbage happens to be equal to the current time step, the event would fire spuriously, even though it wasn't meant to.The fix is straightforward: we just need to check if the set is empty before reading from the set. If it is empty then the event never triggers.