mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Take variable stack size correctly into account for return value packer.
This commit is contained in:
@@ -42,6 +42,15 @@ void CompilerUtils::moveToStackVariable(VariableDeclaration const& _variable)
|
||||
m_context << eth::swapInstruction(stackPosition - size + 1) << eth::Instruction::POP;
|
||||
}
|
||||
|
||||
void CompilerUtils::copyToStackTop(unsigned _stackDepth, const Type& _type)
|
||||
{
|
||||
if (_stackDepth > 16)
|
||||
BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Stack too deep."));
|
||||
unsigned const size = _type.getSizeOnStack();
|
||||
for (unsigned i = 0; i < size; ++i)
|
||||
m_context << eth::dupInstruction(_stackDepth);
|
||||
}
|
||||
|
||||
void CompilerUtils::popStackElement(Type const& _type)
|
||||
{
|
||||
unsigned const size = _type.getSizeOnStack();
|
||||
|
||||
Reference in New Issue
Block a user