[Lldb-commits] [PATCH] D135616: [lldb/Utility] Fix StructuredData::ParseJSONValue for null items

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 10 13:45:10 PDT 2022


mib created this revision.
mib added a reviewer: JDevlieghere.
mib added a project: LLDB.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

This patch fixes the JSON parser for StructuredData to handle JSON null
entries.

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135616

Files:
  lldb/source/Utility/StructuredData.cpp


Index: lldb/source/Utility/StructuredData.cpp
===================================================================
--- lldb/source/Utility/StructuredData.cpp
+++ lldb/source/Utility/StructuredData.cpp
@@ -69,6 +69,9 @@
   if (auto d = value.getAsNumber())
     return std::make_shared<StructuredData::Float>(*d);
 
+  if (auto n = value.getAsNull())
+    return std::make_shared<StructuredData::Null>();
+
   return StructuredData::ObjectSP();
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135616.466607.patch
Type: text/x-patch
Size: 448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221010/edc9f2bf/attachment.bin>


More information about the lldb-commits mailing list