diff options
author | chriseth <c@ethdev.com> | 2017-01-21 02:01:19 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-01-21 02:01:19 +0800 |
commit | 2536bdd6d0dfa1685967fd3106c682e0bcf17021 (patch) | |
tree | 9f90a43745c2b2adbfdbcc29aa2e3ced963b63a3 /libsolidity/codegen/ExpressionCompiler.cpp | |
parent | 12b002b3b8575539f332c30691e880bcc2fac5bc (diff) | |
download | dexon-solidity-2536bdd6d0dfa1685967fd3106c682e0bcf17021.tar.gz dexon-solidity-2536bdd6d0dfa1685967fd3106c682e0bcf17021.tar.zst dexon-solidity-2536bdd6d0dfa1685967fd3106c682e0bcf17021.zip |
Report source location on "stack too deep" errors.
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 37bd1458..81d3409e 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -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; |