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

Risk stack-use-after-scope error when getting const reference of value held in optional

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Repl 2021-03-22
    • 185

      This is the block of code that's problematic. getTxnNumber() and getStatementId() return by value and the operator* gets in the way so that the lifetime of the temporary optional is not extended.

            Assignee:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Reporter:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: