Report location on stack too deep if possible

This commit is contained in:
Alex Beregszaszi
2017-07-26 22:56:55 +01:00
parent a605e4eb95
commit af57879187
2 changed files with 7 additions and 1 deletions
+6 -1
View File
@@ -174,7 +174,12 @@ void ExpressionCompiler::appendStateVariableAccessor(VariableDeclaration const&
retSizeOnStack = returnTypes.front()->sizeOnStack();
}
solAssert(retSizeOnStack == utils().sizeOnStack(returnTypes), "");
solAssert(retSizeOnStack <= 15, "Stack is too deep.");
if (retSizeOnStack > 15)
BOOST_THROW_EXCEPTION(
CompilerError() <<
errinfo_sourceLocation(_varDecl.location()) <<
errinfo_comment("Stack too deep.")
);
m_context << dupInstruction(retSizeOnStack + 1);
m_context.appendJump(eth::AssemblyItem::JumpType::OutOfFunction);
}