aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/Assembly.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-09-18 20:36:31 +0800
committerGitHub <noreply@github.com>2017-09-18 20:36:31 +0800
commitf473a43a25b562ee91aa8ddddd35f4174e0d4456 (patch)
treed3b762d7d1b8c39efe9bca68b6c545b9eec745d1 /libevmasm/Assembly.cpp
parentc289fd3d9eded048f229add7f6c7f1cfd201b32d (diff)
parentf4b87548c8eac136945795d88b76b10ec87d2ff0 (diff)
downloaddexon-solidity-f473a43a25b562ee91aa8ddddd35f4174e0d4456.tar
dexon-solidity-f473a43a25b562ee91aa8ddddd35f4174e0d4456.tar.gz
dexon-solidity-f473a43a25b562ee91aa8ddddd35f4174e0d4456.tar.bz2
dexon-solidity-f473a43a25b562ee91aa8ddddd35f4174e0d4456.tar.lz
dexon-solidity-f473a43a25b562ee91aa8ddddd35f4174e0d4456.tar.xz
dexon-solidity-f473a43a25b562ee91aa8ddddd35f4174e0d4456.tar.zst
dexon-solidity-f473a43a25b562ee91aa8ddddd35f4174e0d4456.zip
Merge pull request #2921 from ethereum/asm-assertion-messages
Add useful messages to exceptions in the assembler
Diffstat (limited to 'libevmasm/Assembly.cpp')
-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.");