Skip to content

Commit 7dc324a

Browse files
committed
[lldb] Fix crash in FormatEntity for mangled-name
Check a `Block` pointer before dereferencing. Using `function.mangled-name` led to a crash for a frame where the symbol context had no block info. In my case, the frame's function was a system frame. Differential Revision: https://reviews.llvm.org/D96307
1 parent 9202806 commit 7dc324a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/Core/FormatEntity.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ bool FormatEntity::Format(const Entry &entry, Stream &s,
17691769
return false;
17701770
s.PutCString(name);
17711771

1772-
if (sc->block->GetContainingInlinedBlock()) {
1772+
if (sc->block && sc->block->GetContainingInlinedBlock()) {
17731773
if (const InlineFunctionInfo *inline_info =
17741774
sc->block->GetInlinedFunctionInfo()) {
17751775
s.PutCString(" [inlined] ");

0 commit comments

Comments
 (0)