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

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 3 14:45:23 PDT 2022


Author: Med Ismail Bennani
Date: 2022-11-03T14:44:52-07:00
New Revision: 90608963d40b4765fc95e039d5100940ad822535

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

LOG: [lldb/Utility] Fix StructuredData::ParseJSONValue for null items

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

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

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

Added: 
    

Modified: 
    lldb/source/Utility/StructuredData.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Utility/StructuredData.cpp b/lldb/source/Utility/StructuredData.cpp
index fc10fa539e9e5..2e023344f3ddb 100644
--- a/lldb/source/Utility/StructuredData.cpp
+++ b/lldb/source/Utility/StructuredData.cpp
@@ -69,6 +69,9 @@ static StructuredData::ObjectSP ParseJSONValue(json::Value &value) {
   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();
 }
 


        


More information about the lldb-commits mailing list