Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18373

MONGO_COMPILER_UNREACHABLE should terminate if violated

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • None
    • 3.0.9, 3.1.3
    • Internal Code
    • None
    • Fully Compatible
    • Platform 3 05/15/15

    Description

      The current MONGO_COMPILER_UNREACHABLE simply uses __builtin_unreachable, however if control does flow past it then the behavior is undefined.

      We would prefer to terminate. We should write a new macro MONGO_UNREACHABLE, that invokes invariantFailed or similar. Optionally, the macro could follow that call to invariantFailed with __builtin_unreachable, however this should probably be unnecessary, as whatever function is called by the macro should be tagged noreturn.

      Attachments

        Issue Links

          Activity

            People

              adam.midvidy Adam Midvidy
              andrew.morrow@mongodb.com Andrew Morrow (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: