mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove single use Assembly::popTo
This commit is contained in:
parent
18fc667658
commit
6a260a9ff1
@ -84,8 +84,6 @@ public:
|
|||||||
void ignored() { m_baseDeposit = m_deposit; }
|
void ignored() { m_baseDeposit = m_deposit; }
|
||||||
void endIgnored() { m_deposit = m_baseDeposit; m_baseDeposit = 0; }
|
void endIgnored() { m_deposit = m_baseDeposit; m_baseDeposit = 0; }
|
||||||
|
|
||||||
void popTo(int _deposit) { while (m_deposit > _deposit) append(solidity::Instruction::POP); }
|
|
||||||
|
|
||||||
void injectStart(AssemblyItem const& _i);
|
void injectStart(AssemblyItem const& _i);
|
||||||
int deposit() const { return m_deposit; }
|
int deposit() const { return m_deposit; }
|
||||||
void adjustDeposit(int _adjustment) { m_deposit += _adjustment; if (asserts(m_deposit >= 0)) BOOST_THROW_EXCEPTION(InvalidDeposit()); }
|
void adjustDeposit(int _adjustment) { m_deposit += _adjustment; if (asserts(m_deposit >= 0)) BOOST_THROW_EXCEPTION(InvalidDeposit()); }
|
||||||
|
@ -571,7 +571,9 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s)
|
|||||||
{
|
{
|
||||||
for (auto const& i: code)
|
for (auto const& i: code)
|
||||||
m_asm.append(i.m_asm);
|
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")
|
else if (us == "BYTECODESIZE")
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user