[Lldb-commits] [lldb] 1857d29 - [lldb/Target] Add null-check before dereferencing inlined_info (NFC) (#116300)
via lldb-commits
lldb-commits at lists.llvm.org
Thu Nov 14 16:12:41 PST 2024
Author: Med Ismail Bennani
Date: 2024-11-14T16:12:38-08:00
New Revision: 1857d297354fd307d2b30ff69036cc343d2fd692
URL: https://github.com/llvm/llvm-project/commit/1857d297354fd307d2b30ff69036cc343d2fd692
DIFF: https://github.com/llvm/llvm-project/commit/1857d297354fd307d2b30ff69036cc343d2fd692.diff
LOG: [lldb/Target] Add null-check before dereferencing inlined_info (NFC) (#116300)
This patch is a follow-up to 9c7701fa78037af03be10ed168fd3c75a2ed1aef
and adds extra-null checks before dereferencing the inlined_info
pointer.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
Added:
Modified:
lldb/source/Target/StackFrame.cpp
Removed:
################################################################################
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