[Lldb-commits] [lldb] Convert the StackFrameList mutex to a shared mutex. (PR #117252)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 10 07:54:27 PST 2024


================
@@ -803,13 +819,12 @@ uint32_t StackFrameList::SetSelectedFrame(lldb_private::StackFrame *frame) {
       break;
     }
   }
-
   SetDefaultFileAndLineToSelectedFrame();
-  return *m_selected_frame_idx;
+  result = *m_selected_frame_idx;
----------------
labath wrote:

What's up with the result variable? C++ guarantees that the result will be computed before the destructors are run precisely so that code like `return protected_object->some_operation()` is safe.

https://github.com/llvm/llvm-project/pull/117252


More information about the lldb-commits mailing list