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.benn...@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();
 }
 


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to