Document fassert, tighten against misuse, fix misuses

XMLWordPrintableJSON

    • Server Programmability
    • Fully Compatible
    • v8.0
    • Programmability 2024-06-10
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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?).

              Assignee:
              Billy Donahue
              Reporter:
              James Bronsted
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: