aboutsummaryrefslogtreecommitdiffstats
path: root/liblll/CodeFragment.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-15 14:41:14 +0800
committerGitHub <noreply@github.com>2017-06-15 14:41:14 +0800
commit3cb71ac51624377174029e244b3cef950dedbfe8 (patch)
treec562a2a0577edbe6cfcda9e10ee63e7643763b80 /liblll/CodeFragment.cpp
parent71fea1e370dfb2d9cb812bcd40b2f8a63ed1d5e0 (diff)
parentc08c4b8b6f0e8c4ccc139e525218cb0cb1ac4ad4 (diff)
downloaddexon-solidity-3cb71ac51624377174029e244b3cef950dedbfe8.tar
dexon-solidity-3cb71ac51624377174029e244b3cef950dedbfe8.tar.gz
dexon-solidity-3cb71ac51624377174029e244b3cef950dedbfe8.tar.bz2
dexon-solidity-3cb71ac51624377174029e244b3cef950dedbfe8.tar.lz
dexon-solidity-3cb71ac51624377174029e244b3cef950dedbfe8.tar.xz
dexon-solidity-3cb71ac51624377174029e244b3cef950dedbfe8.tar.zst
dexon-solidity-3cb71ac51624377174029e244b3cef950dedbfe8.zip
Merge pull request #2398 from ethereum/assembly-cleanup
Remove obsolete features from libevmasm
Diffstat (limited to 'liblll/CodeFragment.cpp')
-rw-r--r--liblll/CodeFragment.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp
index 0f7f48ba..9f37bc65 100644
--- a/liblll/CodeFragment.cpp
+++ b/liblll/CodeFragment.cpp
@@ -515,8 +515,7 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
requireMaxSize(3);
requireDeposit(1, 1);
- auto subPush = m_asm.newSub(make_shared<Assembly>(code[0].assembly(ns)));
- m_asm.append(m_asm.newPushSubSize(subPush.data()));
+ auto subPush = m_asm.appendSubroutine(make_shared<Assembly>(code[0].assembly(ns)));
m_asm.append(Instruction::DUP1);
if (code.size() == 3)
{
@@ -571,7 +570,9 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
{
for (auto const& i: code)
m_asm.append(i.m_asm);
- m_asm.popTo(1);
+ // Leave only the last item on stack.
+ while (m_asm.deposit() > 1)
+ m_asm.append(Instruction::POP);
}
else if (us == "BYTECODESIZE")
{