aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-04-19 22:53:11 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-04-21 02:38:00 +0800
commitf71b465eb7575ae7639fbd03b550208c8f31ce43 (patch)
tree554a86d2f6a1e708990302416c8948a6938a0b9f
parent6d132602326e9a981141d9e5213ba65c423dd099 (diff)
downloaddexon-solidity-f71b465eb7575ae7639fbd03b550208c8f31ce43.tar.gz
dexon-solidity-f71b465eb7575ae7639fbd03b550208c8f31ce43.tar.zst
dexon-solidity-f71b465eb7575ae7639fbd03b550208c8f31ce43.zip
Ensure the language field is present in the JSON
-rw-r--r--libsolidity/interface/StandardCompiler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp
index bd2e64c6..3cff319f 100644
--- a/libsolidity/interface/StandardCompiler.cpp
+++ b/libsolidity/interface/StandardCompiler.cpp
@@ -152,6 +152,12 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
{
m_compilerStack.reset(false);
+ if (!_input.isObject())
+ return formatFatalError("JSONError", "Input is not a JSON object.");
+
+ if (_input["language"] != "Solidity")
+ return formatFatalError("JSONError", "Only \"Solidity\" is supported as a language.");
+
Json::Value const& sources = _input["sources"];
if (!sources)
return formatFatalError("JSONError", "No input sources specified.");