Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missed a null-ptr check in previous PR for Debuginfod testing #86292

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

kevinfrei
Copy link
Contributor

@GeorgeHuyubo noticed an unchecked shared pointer result in #85693. This is the fix for that issue.

@kevinfrei kevinfrei marked this pull request as ready for review March 22, 2024 15:07
@llvmbot llvmbot added the lldb label Mar 22, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 22, 2024

@llvm/pr-subscribers-lldb

Author: Kevin Frei (kevinfrei)

Changes

@GeorgeHuyubo noticed an unchecked shared pointer result in #85693. This is the fix for that issue.


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

1 Files Affected:

  • (modified) lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp (+1-1)
diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
index 91b8b4a979e0c7..a9956aa9075fe2 100644
--- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -53,7 +53,7 @@ static bool IsDwpSymbolFile(const lldb::ModuleSP &module_sp,
   ObjectFileSP dwp_obj_file = ObjectFile::FindPlugin(
       module_sp, &file_spec, 0, FileSystem::Instance().GetByteSize(file_spec),
       dwp_file_data_sp, dwp_file_data_offset);
-  if (!ObjectFileELF::classof(dwp_obj_file.get()))
+  if (!dwp_obj_file || !ObjectFileELF::classof(dwp_obj_file.get()))
     return false;
   // The presence of a debug_cu_index section is the key identifying feature of
   // a DWP file. Make sure we don't fill in the section list on dwp_obj_file

Copy link
Contributor

@GeorgeHuyubo GeorgeHuyubo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@clayborg clayborg merged commit b1575f9 into llvm:main Mar 22, 2024
8 checks passed
omjavaid added a commit that referenced this pull request Mar 22, 2024
chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
…6292)

@GeorgeHuyubo noticed an unchecked shared pointer result in
llvm#85693. This is the fix for
that issue.

Co-authored-by: Kevin Frei <freik@meta.com>
@kevinfrei kevinfrei deleted the debuginfod-nullptrfix branch July 2, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants