aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface/StandardCompiler.cpp
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-08-10 02:37:49 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-08-11 01:26:48 +0800
commit954d7433bd8c10bce917326f70070077f0cfc165 (patch)
treef73a2699f3fc369fd9ae3783b271e9a11171fe80 /libsolidity/interface/StandardCompiler.cpp
parent43db88b8363d73ee2f5ffa094ff506414261bd11 (diff)
downloaddexon-solidity-954d7433bd8c10bce917326f70070077f0cfc165.tar.gz
dexon-solidity-954d7433bd8c10bce917326f70070077f0cfc165.tar.zst
dexon-solidity-954d7433bd8c10bce917326f70070077f0cfc165.zip
Disallow remappings with empty prefix.
Diffstat (limited to 'libsolidity/interface/StandardCompiler.cpp')
-rw-r--r--libsolidity/interface/StandardCompiler.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp
index 58b84163..c1996777 100644
--- a/libsolidity/interface/StandardCompiler.cpp
+++ b/libsolidity/interface/StandardCompiler.cpp
@@ -326,9 +326,14 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
m_compilerStack.setEVMVersion(*version);
}
- vector<string> remappings;
+ vector<CompilerStack::Remapping> remappings;
for (auto const& remapping: settings.get("remappings", Json::Value()))
- remappings.push_back(remapping.asString());
+ {
+ if (auto r = CompilerStack::parseRemapping(remapping.asString()))
+ remappings.emplace_back(std::move(*r));
+ else
+ return formatFatalError("JSONError", "Invalid remapping: \"" + remapping.asString() + "\"");
+ }
m_compilerStack.setRemappings(remappings);
Json::Value optimizerSettings = settings.get("optimizer", Json::Value());