[Lldb-commits] [lldb] [lldb/Target] Add null-check before dereferencing inlined_info (NFC) (PR #116300)
Med Ismail Bennani via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 14 16:08:59 PST 2024
https://github.com/medismailben created https://github.com/llvm/llvm-project/pull/116300
This patch is a follow-up to 5b6b0c97ff09de2850577bbabe1f0c296d1c7af1 and adds extra-null checks before dereferencing the inlined_info pointer.
>From cbd6cd71cdd99db615445d0c5591482a12b61df8 Mon Sep 17 00:00:00 2001
From: Med Ismail Bennani <ismail at bennani.ma>
Date: Thu, 14 Nov 2024 16:06:13 -0800
Subject: [PATCH] [lldb/Target] Add null-check before dereferencing
inlined_info (NFC)
This patch is a follow-up to 5b6b0c97ff09de2850577bbabe1f0c296d1c7af1
and adds extra-null checks before dereferencing the inlined_info
pointer.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
---
lldb/source/Target/StackFrame.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
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();
}
}
More information about the lldb-commits
mailing list