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

Replace boost::optional::get() with boost::optional::value in DensifyValue to avoid undefined behavior

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0, 5.1.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v5.1
    • 115

      boost::optional::get() has undefined behavior without checking if the optional exists with has_value() first. We are already switching on the underlying type of the variant _value, so if we want to throw an assertion if the invariant that the densify value and the densify unit are different, we should switch to boost::optional::value() in those cases.

            Assignee:
            davis.haupt@mongodb.com Davis Haupt (Inactive)
            Reporter:
            davis.haupt@mongodb.com Davis Haupt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: