aboutsummaryrefslogtreecommitdiffstats
path: root/liblll
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-20 18:02:31 +0800
committerGitHub <noreply@github.com>2017-07-20 18:02:31 +0800
commitd70974ea7caced467c7ce5a7597c66d89e111109 (patch)
tree83cfb050fc5f4d205bc8f19ca9f47cac501eb85c /liblll
parent1dd4c7043bde70b0770ecdec036b8e8c949979e8 (diff)
parent4c0953385e4d6d0a9869259efb52ac5fbc0b7f3d (diff)
downloaddexon-solidity-d70974ea7caced467c7ce5a7597c66d89e111109.tar.gz
dexon-solidity-d70974ea7caced467c7ce5a7597c66d89e111109.tar.zst
dexon-solidity-d70974ea7caced467c7ce5a7597c66d89e111109.zip
Merge pull request #2573 from benjaminion/lll-error-report-symbol
LLL: Improve error reporting in certain cases.
Diffstat (limited to 'liblll')
-rw-r--r--liblll/CodeFragment.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index 794bef81..254f436f 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -203,7 +203,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
else if (us == "INCLUDE")
{
if (_t.size() != 2)
- error<IncorrectParameterCount>();
+ error<IncorrectParameterCount>(us);
string fileName = firstAsString();
if (fileName.empty())
error<InvalidName>("Empty file name provided");
@@ -215,7 +215,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
else if (us == "SET")
{
if (_t.size() != 3)
- error<IncorrectParameterCount>();
+ error<IncorrectParameterCount>(us);
int c = 0;
for (auto const& i: _t)
if (c++ == 2)
@@ -226,7 +226,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
else if (us == "GET")
{
if (_t.size() != 2)
- error<IncorrectParameterCount>();
+ error<IncorrectParameterCount>(us);
m_asm.append((u256)varAddress(firstAsString()));
m_asm.append(Instruction::MLOAD);
}
@@ -237,7 +237,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
string n;
unsigned ii = 0;
if (_t.size() != 3 && _t.size() != 4)
- error<IncorrectParameterCount>();
+ error<IncorrectParameterCount>(us);
vector<string> args;
for (auto const& i: _t)
{
@@ -288,7 +288,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
else if (us == "LIT")
{
if (_t.size() < 3)
- error<IncorrectParameterCount>();
+ error<IncorrectParameterCount>(us);
unsigned ii = 0;
CodeFragment pos;
bytes data;
@@ -303,7 +303,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
{
pos = CodeFragment(i, _s);
if (pos.m_asm.deposit() != 1)
- error<InvalidDeposit>();
+ error<InvalidDeposit>(us);
}
else if (i.tag() != 0)
{
@@ -384,10 +384,10 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
else
code.push_back(CodeFragment(i, _s));
}
- auto requireSize = [&](unsigned s) { if (code.size() != s) error<IncorrectParameterCount>(); };
- auto requireMinSize = [&](unsigned s) { if (code.size() < s) error<IncorrectParameterCount>(); };
- auto requireMaxSize = [&](unsigned s) { if (code.size() > s) error<IncorrectParameterCount>(); };
- auto requireDeposit = [&](unsigned i, int s) { if (code[i].m_asm.deposit() != s) error<InvalidDeposit>(); };
+ auto requireSize = [&](unsigned s) { if (code.size() != s) error<IncorrectParameterCount>(us); };
+ auto requireMinSize = [&](unsigned s) { if (code.size() < s) error<IncorrectParameterCount>(us); };
+ auto requireMaxSize = [&](unsigned s) { if (code.size() > s) error<IncorrectParameterCount>(us); };
+ auto requireDeposit = [&](unsigned i, int s) { if (code[i].m_asm.deposit() != s) error<InvalidDeposit>(us); };
if (_s.macros.count(make_pair(s, code.size())))
{
@@ -471,7 +471,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
m_asm.append(code[1].m_asm, minDep);
m_asm << end.tag();
if (m_asm.deposit() != deposit)
- error<InvalidDeposit>();
+ error<InvalidDeposit>(us);
}
else if (us == "WHEN" || us == "UNLESS")
{