-
-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UBSan error at early startup about converting infinity to int.
This happens because during early startup, the FPS value returned by the stats is zero, and 1 / 0 = inf, and static_cast<int>(inf) is undefined behavior. Also, I removed one case as it's dead code (measurements_cnt <= 0 cannot happen as the function itself increments it), and riddled the timing code with asserts and comments explaining why each assert is always true.
- Loading branch information
Showing
1 changed file
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters