This is an archive of the discontinued LLVM Phabricator instance.

[LLDB][NFC] Reliability Fixes for FormatEntity
ClosedPublic

Authored by fixathon on Aug 14 2022, 1:04 AM.

Details

Summary
  • Remove dead code
  • Fix incorrect null-reference check

Diff Detail

Event Timeline

fixathon created this revision.Aug 14 2022, 1:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2022, 1:04 AM
fixathon published this revision for review.Aug 15 2022, 8:34 AM
fixathon added inline comments.
lldb/source/Core/FormatEntity.cpp
714–715

This null-check is unreachable and redundant. valobj is already completely null-checked at lines 675 and 705.

1695

Checking var_value_sp for null here is moot; it's already dereferenced in the preceding line. However, exe_scope does require a null-check here, and from the context, it appears that was the original intent thwarted by a typo.

Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2022, 8:34 AM
This revision is now accepted and ready to land.Aug 15 2022, 9:52 AM
This revision was automatically updated to reflect the committed changes.