mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Report source location on "stack too deep" errors.
This commit is contained in:
1 parent
12b002b3b8
commit
2536bdd6d0
3 files changed
+16
-3
No files matched your search
@@ -250,7 +250,12 @@ bool ExpressionCompiler::visit(Assignment const& _assignment)
|
||||
}
|
||||
if (lvalueSize > 0)
|
||||
{
|
||||
solAssert(itemSize + lvalueSize <= 16, "Stack too deep, try removing local variables.");
|
||||
if (itemSize + lvalueSize > 16)
|
||||
BOOST_THROW_EXCEPTION(
|
||||
CompilerError() <<
|
||||
errinfo_sourceLocation(_assignment.location()) <<
|
||||
errinfo_comment("Stack too deep, try removing local variables.")
|
||||
);
|
||||
// value [lvalue_ref] updated_value
|
||||
for (unsigned i = 0; i < itemSize; ++i)
|
||||
m_context << swapInstruction(itemSize + lvalueSize) << Instruction::POP;
|
||||
|
||||
Reference in new issue
Block a user