Author: Jonas Devlieghere Date: 2025-10-09T12:05:00-07:00 New Revision: eb06c7e7d25da30dd611812a9bec56bf5c3f5ac3
URL: https://github.com/llvm/llvm-project/commit/eb06c7e7d25da30dd611812a9bec56bf5c3f5ac3 DIFF: https://github.com/llvm/llvm-project/commit/eb06c7e7d25da30dd611812a9bec56bf5c3f5ac3.diff LOG: [lldb] Fix assertion caused by invalid SupportFileSP (#162710) SupportFileSP should never be null, and instead should use a default constructed SupportFile to represent an invalid instance. This is because the class used to be a value type before it became polymorphic. We have various places in LLDB where we check this precondition, including in DisplaySourceLinesWithLineNumbers. The assertion was tripped when calling GetStartLineSourceInfo which starts by resetting the SupportFileSP and has a series of early returns which leave the shared pointer in that state. rdar://161607247 Added: Modified: lldb/source/Symbol/Function.cpp Removed: ################################################################################ diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index 6114eccd935ee..2be1e389aa1d0 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -275,7 +275,7 @@ Function::~Function() = default; void Function::GetStartLineSourceInfo(SupportFileSP &source_file_sp, uint32_t &line_no) { line_no = 0; - source_file_sp.reset(); + source_file_sp = std::make_shared<SupportFile>(); if (m_comp_unit == nullptr) return; _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
