llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

<details>
<summary>Changes</summary>

This fixes the following assertion: "Cannot create Expected&lt;T&gt; from Error 
success value." The problem was that GetFrameBaseValue returned false without 
updating the Status argument. This patch makes sure that every return path 
updates the Status if the pointer is valid.

---
Full diff: https://github.com/llvm/llvm-project/pull/111882.diff


1 Files Affected:

- (modified) lldb/source/Target/StackFrame.cpp (+3-1) 


``````````diff
diff --git a/lldb/source/Target/StackFrame.cpp 
b/lldb/source/Target/StackFrame.cpp
index fe0d4c93c50627..730ec0387917f8 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -1084,7 +1084,9 @@ bool StackFrame::GetFrameBaseValue(Scalar &frame_base, 
Status *error_ptr) {
   if (!m_cfa_is_valid) {
     m_frame_base_error = Status::FromErrorString(
         "No frame base available for this historical stack frame.");
-    return false;
+    if (error_ptr)
+      *error_ptr = m_frame_base_error.Clone();
+    return m_frame_base_error.Success();
   }
 
   if (m_flags.IsClear(GOT_FRAME_BASE)) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/111882
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to