diff options
Diffstat (limited to 'lldb/source/API/SBStructuredData.cpp')
| -rw-r--r-- | lldb/source/API/SBStructuredData.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/API/SBStructuredData.cpp b/lldb/source/API/SBStructuredData.cpp index b18fc5655fc8..78afdc69fe0d 100644 --- a/lldb/source/API/SBStructuredData.cpp +++ b/lldb/source/API/SBStructuredData.cpp @@ -86,7 +86,12 @@ lldb::SBError SBStructuredData::SetFromJSON(lldb::SBStream &stream) { StructuredData::ParseJSON(stream.GetData()); m_impl_up->SetObjectSP(json_obj); - if (!json_obj || json_obj->GetType() != eStructuredDataTypeDictionary) + static constexpr StructuredDataType unsupported_type[] = { + eStructuredDataTypeInvalid, + eStructuredDataTypeGeneric, + }; + + if (!json_obj || llvm::is_contained(unsupported_type, json_obj->GetType())) error.SetErrorString("Invalid Syntax"); return error; } |
