aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CompilerUtils.cpp')
-rw-r--r--CompilerUtils.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/CompilerUtils.cpp b/CompilerUtils.cpp
index e3d8f7f9..3549ef98 100644
--- a/CompilerUtils.cpp
+++ b/CompilerUtils.cpp
@@ -142,22 +142,25 @@ void CompilerUtils::moveToStackVariable(VariableDeclaration const& _variable)
solAssert(stackPosition >= size, "Variable size and position mismatch.");
// move variable starting from its top end in the stack
if (stackPosition - size + 1 > 16)
- BOOST_THROW_EXCEPTION(CompilerError() << errinfo_sourceLocation(_variable.getLocation())
- << errinfo_comment("Stack too deep."));
+ BOOST_THROW_EXCEPTION(
+ CompilerError() <<
+ errinfo_sourceLocation(_variable.getLocation()) <<
+ errinfo_comment("Stack too deep, try removing local variables.")
+ );
for (unsigned i = 0; i < size; ++i)
m_context << eth::swapInstruction(stackPosition - size + 1) << eth::Instruction::POP;
}
void CompilerUtils::copyToStackTop(unsigned _stackDepth, unsigned _itemSize)
{
- solAssert(_stackDepth <= 16, "Stack too deep.");
+ solAssert(_stackDepth <= 16, "Stack too deep, try removing local variables.");
for (unsigned i = 0; i < _itemSize; ++i)
m_context << eth::dupInstruction(_stackDepth);
}
void CompilerUtils::moveToStackTop(unsigned _stackDepth)
{
- solAssert(_stackDepth <= 15, "Stack too deep.");
+ solAssert(_stackDepth <= 15, "Stack too deep, try removing local variables.");
for (unsigned i = 0; i < _stackDepth; ++i)
m_context << eth::swapInstruction(1 + i);
}