Skip to content

[lldb/Target] Add null-check before dereferencing inlined_info (NFC) #116300

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

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

medismailben
Copy link
Member

@medismailben medismailben commented Nov 15, 2024

This patch is a follow-up to 9c7701f and adds extra-null checks before dereferencing the inlined_info pointer.

This patch is a follow-up to 9c7701f
and adds extra-null checks before dereferencing the inlined_info
pointer.

Signed-off-by: Med Ismail Bennani <[email protected]>
@medismailben medismailben force-pushed the inlined-info-null-check branch from cbd6cd7 to fd5ba55 Compare November 15, 2024 00:10
@medismailben medismailben merged commit 1857d29 into llvm:main Nov 15, 2024
4 of 6 checks passed
medismailben added a commit to medismailben/llvm-project that referenced this pull request Nov 15, 2024
…lvm#116300)

This patch is a follow-up to 9c7701f
and adds extra-null checks before dereferencing the inlined_info
pointer.

Signed-off-by: Med Ismail Bennani <[email protected]>
(cherry picked from commit 1857d29)
@llvmbot llvmbot added the lldb label Nov 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Nov 16, 2024

@llvm/pr-subscribers-lldb

Author: Med Ismail Bennani (medismailben)

Changes

This patch is a follow-up to 9c7701f and adds extra-null checks before dereferencing the inlined_info pointer.


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

1 Files Affected:

  • (modified) lldb/source/Target/StackFrame.cpp (+4-2)
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index 77179fec3ed438..1bca9786fb7c70 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -1239,7 +1239,8 @@ const char *StackFrame::GetFunctionName() {
     if (inlined_block) {
       const InlineFunctionInfo *inlined_info =
           inlined_block->GetInlinedFunctionInfo();
-      name = inlined_info->GetName().AsCString();
+      if (inlined_info)
+        name = inlined_info->GetName().AsCString();
     }
   }
 
@@ -1265,7 +1266,8 @@ const char *StackFrame::GetDisplayFunctionName() {
     if (inlined_block) {
       const InlineFunctionInfo *inlined_info =
           inlined_block->GetInlinedFunctionInfo();
-      name = inlined_info->GetDisplayName().AsCString();
+      if (inlined_info)
+        name = inlined_info->GetDisplayName().AsCString();
     }
   }
 

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.

3 participants