[Lldb-commits] [lldb] [lldb] Don't dereference a possibly null DataExtractor in FindPlugin (PR #224347)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 17 08:52:31 PDT 2026


https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/224347

Restore the behavior from before e4c83b7b119c, which changed the parameter from a DataBufferSP the branch guaranteed to be null-or-empty into a DataExtractorSP it unconditionally dereferences.

No in-tree caller reaches this branch with a null extractor, so there is no test.

rdar://168105064

>From 806314b92453949525ab00bdf4628015f5bf1663 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jonas at devlieghere.com>
Date: Thu, 17 Sep 2026 08:50:30 -0700
Subject: [PATCH] [lldb] Don't dereference a possibly null DataExtractor in
 FindPlugin

Restore the behavior from before e4c83b7b119c, which changed the
parameter from a DataBufferSP the branch guaranteed to be null-or-empty
into a DataExtractorSP it unconditionally dereferences.

No in-tree caller reaches this branch with a null extractor, so there is
no test.

rdar://168105064
---
 lldb/source/Symbol/ObjectFile.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp
index 89d01568de9264..560b8c7d679b06 100644
--- a/lldb/source/Symbol/ObjectFile.cpp
+++ b/lldb/source/Symbol/ObjectFile.cpp
@@ -111,9 +111,9 @@ ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,
         // ANY data in case there is data cached in the container plug-ins
         // (like BSD archives caching the contained objects within an
         // file).
-        ObjectFileSP object_file_sp = CreateObjectFromContainer(
-            module_sp, file, file_offset, file_size,
-            extractor_sp->GetSharedDataBuffer(), data_offset);
+        ObjectFileSP object_file_sp =
+            CreateObjectFromContainer(module_sp, file, file_offset, file_size,
+                                      DataBufferSP(), data_offset);
         if (object_file_sp)
           return object_file_sp;
         // We failed to find any cached object files in the container plug-



More information about the lldb-commits mailing list