[Lldb-commits] [PATCH] D84272: Add checks for ValueObjectSP in Cocoa summary providers

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 22 16:25:16 PDT 2020


shafik updated this revision to Diff 279965.
shafik added a comment.

Removing `text->GetValueAsUnsigned(0) == 0` check.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84272/new/

https://reviews.llvm.org/D84272

Files:
  lldb/source/Plugins/Language/ObjC/Cocoa.cpp


Index: lldb/source/Plugins/Language/ObjC/Cocoa.cpp
===================================================================
--- lldb/source/Plugins/Language/ObjC/Cocoa.cpp
+++ lldb/source/Plugins/Language/ObjC/Cocoa.cpp
@@ -72,6 +72,9 @@
         valobj.GetCompilerType().GetBasicTypeFromAST(lldb::eBasicTypeObjCID),
         true));
 
+    if (!text)
+      return false;
+
     StreamString summary_stream;
     bool was_nsstring_ok =
         NSStringSummaryProvider(*text, summary_stream, options);
@@ -117,6 +120,10 @@
     uint64_t offset = ptr_size;
     ValueObjectSP text(valobj.GetSyntheticChildAtOffset(
         offset, valobj.GetCompilerType(), true));
+
+    if (!text)
+      return false;
+
     StreamString summary_stream;
     bool was_nsstring_ok =
         NSStringSummaryProvider(*text, summary_stream, options);
@@ -162,6 +169,10 @@
     uint64_t offset = ptr_size;
     ValueObjectSP text(valobj.GetSyntheticChildAtOffset(
         offset, valobj.GetCompilerType(), true));
+
+    if (!text)
+      return false;
+
     StreamString summary_stream;
     bool was_nsstring_ok =
         NSStringSummaryProvider(*text, summary_stream, options);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84272.279965.patch
Type: text/x-patch
Size: 1162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200722/2d108609/attachment.bin>


More information about the lldb-commits mailing list