[Lldb-commits] [lldb] [lldb/DWARF] Make sure bad abbreviation codes do not crash lldb (PR #93006)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed May 22 11:24:21 PDT 2024


================
@@ -44,10 +45,20 @@ bool DWARFDebugInfoEntry::Extract(const DWARFDataExtractor &data,
                                   const DWARFUnit *cu,
                                   lldb::offset_t *offset_ptr) {
   m_offset = *offset_ptr;
+  auto report_error = [&](const char *fmt, const auto &...vals) {
+    cu->GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
----------------
JDevlieghere wrote:

Can we assume `cu` is always a valid pointer? If so, should the signature take it by const reference instead? 

AFAIK only `GetAbbreviationDeclarationPtr` checks that it's not NULL but we have a code path that calls the lambda before as well as when `abbrevDecl` is NULL which would happen if CU is NULL. 

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


More information about the lldb-commits mailing list