[Lldb-commits] [lldb] fa51243 - [LLDB][NFC] Reliability Fixes for FormatEntity

Slava Gurevich via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 15 10:16:56 PDT 2022


Author: Slava Gurevich
Date: 2022-08-15T10:16:47-07:00
New Revision: fa5124327a01ef060f2c5a301e9600892bb63280

URL: https://github.com/llvm/llvm-project/commit/fa5124327a01ef060f2c5a301e9600892bb63280
DIFF: https://github.com/llvm/llvm-project/commit/fa5124327a01ef060f2c5a301e9600892bb63280.diff

LOG: [LLDB][NFC] Reliability Fixes for FormatEntity

 - Remove dead code
 - Fix incorrect null-reference check

Differential Revision: https://reviews.llvm.org/D131850

Added: 
    

Modified: 
    lldb/source/Core/FormatEntity.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp
index 0ac8fcabc61b..41c4aba63825 100644
--- a/lldb/source/Core/FormatEntity.cpp
+++ b/lldb/source/Core/FormatEntity.cpp
@@ -711,9 +711,6 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
     return false;
   }
 
-  if (valobj == nullptr)
-    return false;
-
   ValueObject::ExpressionPathAftermath what_next =
       (do_deref_pointer ? ValueObject::eExpressionPathAftermathDereference
                         : ValueObject::eExpressionPathAftermathNothing);
@@ -1695,7 +1692,7 @@ bool FormatEntity::Format(const Entry &entry, Stream &s,
               llvm::StringRef var_representation;
               const char *var_name = var_value_sp->GetName().GetCString();
               if (var_value_sp->GetCompilerType().IsValid()) {
-                if (var_value_sp && exe_scope->CalculateTarget())
+                if (exe_scope && exe_scope->CalculateTarget())
                   var_value_sp =
                       var_value_sp->GetQualifiedRepresentationIfAvailable(
                           exe_scope->CalculateTarget()


        


More information about the lldb-commits mailing list