[Lldb-commits] [lldb] [lldb] Don't crash if no default unwind plan (PR #152481)

via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 7 04:13:57 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Nikita Popov (nikic)

<details>
<summary>Changes</summary>

The code was assuming that if abi_sp is not null, then it will also return a non-null default unwind plan. However, this is not the case at least on s390x, so check for that. In that case, we'll treat it as an invalid frame.

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


1 Files Affected:

- (modified) lldb/source/Target/RegisterContextUnwind.cpp (+5-2) 


``````````diff
diff --git a/lldb/source/Target/RegisterContextUnwind.cpp b/lldb/source/Target/RegisterContextUnwind.cpp
index 9e9e2d86958f3..bdd8578b14dba 100644
--- a/lldb/source/Target/RegisterContextUnwind.cpp
+++ b/lldb/source/Target/RegisterContextUnwind.cpp
@@ -426,9 +426,12 @@ void RegisterContextUnwind::InitializeNonZerothFrame() {
       }
     }
 
-    if (abi_sp) {
-      m_fast_unwind_plan_sp.reset();
+    m_fast_unwind_plan_sp.reset();
+    m_full_unwind_plan_sp.reset();
+    if (abi_sp)
       m_full_unwind_plan_sp = abi_sp->CreateDefaultUnwindPlan();
+
+    if (m_full_unwind_plan_sp) {
       if (m_frame_type != eSkipFrame) // don't override eSkipFrame
       {
         m_frame_type = eNormalFrame;

``````````

</details>


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


More information about the lldb-commits mailing list