diff options
author | chriseth <chris@ethereum.org> | 2017-04-12 01:53:55 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-04-12 01:54:44 +0800 |
commit | 4d715e9055f4c7ba7ef86a540dc2e3fbe0fca3a0 (patch) | |
tree | d51facab8f451bde3bffb2b79aa95991b61ca14d /libevmasm/AssemblyItem.cpp | |
parent | bd48f181b588978461fb4651839c62bcac7888d4 (diff) | |
download | dexon-solidity-4d715e9055f4c7ba7ef86a540dc2e3fbe0fca3a0.tar dexon-solidity-4d715e9055f4c7ba7ef86a540dc2e3fbe0fca3a0.tar.gz dexon-solidity-4d715e9055f4c7ba7ef86a540dc2e3fbe0fca3a0.tar.bz2 dexon-solidity-4d715e9055f4c7ba7ef86a540dc2e3fbe0fca3a0.tar.lz dexon-solidity-4d715e9055f4c7ba7ef86a540dc2e3fbe0fca3a0.tar.xz dexon-solidity-4d715e9055f4c7ba7ef86a540dc2e3fbe0fca3a0.tar.zst dexon-solidity-4d715e9055f4c7ba7ef86a540dc2e3fbe0fca3a0.zip |
Implement missing assembly output functions and do not use PushString for assembly.
Diffstat (limited to 'libevmasm/AssemblyItem.cpp')
-rw-r--r-- | libevmasm/AssemblyItem.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libevmasm/AssemblyItem.cpp b/libevmasm/AssemblyItem.cpp index 26d9fded..55130f28 100644 --- a/libevmasm/AssemblyItem.cpp +++ b/libevmasm/AssemblyItem.cpp @@ -159,18 +159,25 @@ string AssemblyItem::toAssemblyText() const text = toHex(toCompactBigEndian(data(), 1), 1, HexPrefix::Add); break; case PushString: - assertThrow(false, AssemblyException, "Push string assembly output not implemented."); + text = string("data_") + toHex(data()); break; case PushTag: - assertThrow(data() < 0x10000, AssemblyException, "Sub-assembly tags not yet implemented."); - text = string("tag_") + to_string(size_t(data())); + { + size_t sub; + size_t tag; + tie(sub, tag) = splitForeignPushTag(); + if (sub == size_t(-1)) + text = string("tag_") + to_string(tag); + else + text = string("tag_") + to_string(sub) + "_" + to_string(tag); break; + } case Tag: - assertThrow(data() < 0x10000, AssemblyException, "Sub-assembly tags not yet implemented."); + assertThrow(data() < 0x10000, AssemblyException, "Declaration of sub-assembly tag."); text = string("tag_") + to_string(size_t(data())) + ":"; break; case PushData: - assertThrow(false, AssemblyException, "Push data not implemented."); + text = string("data_") + toHex(data()); break; case PushSub: text = string("dataOffset(sub_") + to_string(size_t(data())) + ")"; |