From a14a1254ca3ca524f017fabb701fb36b8dcadb39 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 22 Jun 2017 02:29:01 +0100 Subject: LLL: report errors if (include) failed --- liblll/CodeFragment.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'liblll') 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(); - m_asm.append(CodeFragment::compile(contentsString(firstAsString()), _s).m_asm); + string fileName = firstAsString(); + if (fileName.empty()) + error("Empty file name provided"); + string contents = contentsString(fileName); + if (contents.empty()) + error(std::string("File not found (or empty): ") + fileName); + m_asm.append(CodeFragment::compile(contents, _s).m_asm); } else if (us == "SET") { -- cgit