aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-09-18 18:04:09 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-18 18:32:56 +0800
commitf4b87548c8eac136945795d88b76b10ec87d2ff0 (patch)
tree9beb0bada16091dd9ad7e4f96dd53bd4368d3a41 /libevmasm
parenta0d171722a211720773aae0ded8a80991d44ba9d (diff)
downloaddexon-solidity-f4b87548c8eac136945795d88b76b10ec87d2ff0.tar.gz
dexon-solidity-f4b87548c8eac136945795d88b76b10ec87d2ff0.tar.zst
dexon-solidity-f4b87548c8eac136945795d88b76b10ec87d2ff0.zip
Add useful messages to exceptions in the assembler
Diffstat (limited to 'libevmasm')
-rw-r--r--libevmasm/Assembly.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp
index 31857c09..df691e7d 100644
--- a/libevmasm/Assembly.cpp
+++ b/libevmasm/Assembly.cpp
@@ -320,7 +320,7 @@ Json::Value Assembly::assemblyJSON(StringMap const& _sourceCodes) const
AssemblyItem const& Assembly::append(AssemblyItem const& _i)
{
- assertThrow(m_deposit >= 0, AssemblyException, "");
+ assertThrow(m_deposit >= 0, AssemblyException, "Stack underflow.");
m_deposit += _i.deposit();
m_items.push_back(_i);
if (m_items.back().location().isEmpty() && !m_currentSourceLocation.isEmpty())
@@ -330,7 +330,7 @@ AssemblyItem const& Assembly::append(AssemblyItem const& _i)
AssemblyItem Assembly::namedTag(string const& _name)
{
- assertThrow(!_name.empty(), AssemblyException, "");
+ assertThrow(!_name.empty(), AssemblyException, "Empty named tag.");
if (!m_namedTags.count(_name))
m_namedTags[_name] = size_t(newTag().data());
return AssemblyItem(Tag, m_namedTags.at(_name));
@@ -588,7 +588,7 @@ LinkerObject const& Assembly::assemble() const
ret.bytecode.resize(ret.bytecode.size() + 20);
break;
case Tag:
- assertThrow(i.data() != 0, AssemblyException, "");
+ assertThrow(i.data() != 0, AssemblyException, "Invalid tag position.");
assertThrow(i.splitForeignPushTag().first == size_t(-1), AssemblyException, "Foreign tag.");
assertThrow(ret.bytecode.size() < 0xffffffffL, AssemblyException, "Tag too large.");
assertThrow(m_tagPositionsInBytecode[size_t(i.data())] == size_t(-1), AssemblyException, "Duplicate tag position.");