From cddfec27eef40c1bbf16e8d5881030b85e1082c8 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 2 Oct 2017 11:48:26 +0100 Subject: lll: better error reporting in some cases --- liblll/CodeFragment.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp index 254f436f..5e60f964 100644 --- a/liblll/CodeFragment.cpp +++ b/liblll/CodeFragment.cpp @@ -103,7 +103,7 @@ CodeFragment::CodeFragment(sp::utree const& _t, CompilerState& _s, bool _allowAS { bigint i = *_t.get(); if (i < 0 || i > bigint(u256(0) - 1)) - error(); + error(toString(i)); m_asm.append((u256)i); break; } @@ -157,7 +157,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) { auto i = *++_t.begin(); if (i.tag()) - error(); + error(toString(i)); if (i.which() == sp::utree_type::string_type) { auto sr = i.get, sp::utree_type::string_type>>(); @@ -244,7 +244,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) if (ii == 1) { if (i.tag()) - error(); + error(toString(i)); if (i.which() == sp::utree_type::string_type) { auto sr = i.get, sp::utree_type::string_type>>(); @@ -303,11 +303,11 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) { pos = CodeFragment(i, _s); if (pos.m_asm.deposit() != 1) - error(us); + error(toString(i)); } else if (i.tag() != 0) { - error(); + error(toString(i)); } else if (i.which() == sp::utree_type::string_type) { @@ -318,7 +318,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) { bigint bi = *i.get(); if (bi < 0) - error(); + error(toString(i)); else { bytes tmp = toCompactBigEndian(bi); @@ -327,7 +327,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) } else { - error(); + error(toString(i)); } ii++; -- cgit