-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
-
Fully Compatible
-
v8.0
-
Programmability 2024-06-10
The fassert API doesn't support supplying a message, but some existing code passes in a message as a string literal anyways (example). The effect of passing a string literal in for the assertion predicate is that the const char [] string literal undergoes implicit conversion to bool and then gets evaluated by the assertion logic. Since const char [] is always a valid pointer, the resulting bool is always true, so the fassert both loses the diagnostic information in the message and becomes a no-op.
Fix all the places in the codebase where we fassert against a string literal and investigate ways to prevent these sorts of mistakes in the future (clang tidy check?).