aboutsummaryrefslogtreecommitdiffstats
path: root/liblll
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-06-22 09:29:01 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-06-22 17:56:58 +0800
commita14a1254ca3ca524f017fabb701fb36b8dcadb39 (patch)
treeab90768dd9a5550ce0823d357cadd413974c67e2 /liblll
parent3094e777486c40c91c6cf3432ad60f29b9ada484 (diff)
downloaddexon-solidity-a14a1254ca3ca524f017fabb701fb36b8dcadb39.tar
dexon-solidity-a14a1254ca3ca524f017fabb701fb36b8dcadb39.tar.gz
dexon-solidity-a14a1254ca3ca524f017fabb701fb36b8dcadb39.tar.bz2
dexon-solidity-a14a1254ca3ca524f017fabb701fb36b8dcadb39.tar.lz
dexon-solidity-a14a1254ca3ca524f017fabb701fb36b8dcadb39.tar.xz
dexon-solidity-a14a1254ca3ca524f017fabb701fb36b8dcadb39.tar.zst
dexon-solidity-a14a1254ca3ca524f017fabb701fb36b8dcadb39.zip
LLL: report errors if (include) failed
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 9f37bc65..397a7d57 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")
{