diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-04-19 00:11:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-19 00:11:25 +0800 |
commit | 3cacea74c9589b70fffd0ec620c21043742ceb26 (patch) | |
tree | 87fa14312d1209d97c375228c7c5d05148aa5faf /libevmasm/AssemblyItem.cpp | |
parent | 937397ed9c9f65007fd5c7f4da2e360e74463a5e (diff) | |
parent | 8ebea783f4b32c6ff4bb3771a28127676aeb9bad (diff) | |
download | dexon-solidity-3cacea74c9589b70fffd0ec620c21043742ceb26.tar.gz dexon-solidity-3cacea74c9589b70fffd0ec620c21043742ceb26.tar.zst dexon-solidity-3cacea74c9589b70fffd0ec620c21043742ceb26.zip |
Merge pull request #2117 from ethereum/implementAsmOut
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..e69b5932 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{0}; + size_t tag{0}; + 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())) + ")"; |