aboutsummaryrefslogtreecommitdiffstats
path: root/liblll
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-22 23:18:34 +0800
committerGitHub <noreply@github.com>2017-06-22 23:18:34 +0800
commit0868a50eb1d0014fc582ab8bfdf6db0bb9d385ab (patch)
tree134e340f373c6b7555b7f9e48c4da0ee38f61e48 /liblll
parentf90a514f80b74518fbbdd7ef3a511df4f13abed2 (diff)
parenta14a1254ca3ca524f017fabb701fb36b8dcadb39 (diff)
downloaddexon-solidity-0868a50eb1d0014fc582ab8bfdf6db0bb9d385ab.tar.gz
dexon-solidity-0868a50eb1d0014fc582ab8bfdf6db0bb9d385ab.tar.zst
dexon-solidity-0868a50eb1d0014fc582ab8bfdf6db0bb9d385ab.zip
Merge pull request #2440 from ethereum/lll-include
LLL: better error reporting in (include)
Diffstat (limited to 'liblll')
-rw-r--r--liblll/CodeFragment.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index afef63e9..1329ec9b 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -192,7 +192,13 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
{
if (_t.size() != 2)
error<IncorrectParameterCount>();
- m_asm.append(CodeFragment::compile(contentsString(firstAsString()), _s).m_asm);
+ string fileName = firstAsString();
+ if (fileName.empty())
+ error<InvalidName>("Empty file name provided");
+ string contents = contentsString(fileName);
+ if (contents.empty())
+ error<InvalidName>(std::string("File not found (or empty): ") + fileName);
+ m_asm.append(CodeFragment::compile(contents, _s).m_asm);
}
else if (us == "SET")
{