aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-17 09:13:16 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-21 23:28:30 +0800
commit4b56829ac3dc28ea9ca6945fee22963149bcc2bd (patch)
tree5b1a73cf130e8dfd8f6bec3851263d4ebceebaa7
parente3f90565d8f623537072d84316d476343c2b06ad (diff)
downloaddexon-solidity-4b56829ac3dc28ea9ca6945fee22963149bcc2bd.tar.gz
dexon-solidity-4b56829ac3dc28ea9ca6945fee22963149bcc2bd.tar.zst
dexon-solidity-4b56829ac3dc28ea9ca6945fee22963149bcc2bd.zip
Create children node in ASTJsonConverter when neccesary
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp
index fdec8945..6d541803 100644
--- a/libsolidity/ast/ASTJsonConverter.cpp
+++ b/libsolidity/ast/ASTJsonConverter.cpp
@@ -91,11 +91,19 @@ void ASTJsonConverter::setJsonNode(
))
{
if (e.second.isObject())
+ {
+ if (!m_currentValue["children"].isArray())
+ m_currentValue["children"] = Json::arrayValue;
appendMove(m_currentValue["children"], std::move(e.second));
+ }
if (e.second.isArray())
for (auto& child: e.second)
if (!child.isNull())
+ {
+ if (!m_currentValue["children"].isArray())
+ m_currentValue["children"] = Json::arrayValue;
appendMove(m_currentValue["children"], std::move(child));
+ }
}
else
{