diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-19 09:26:41 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-27 05:56:55 +0800 |
commit | af57879187b65bf1deebd96ba80d08bd10f2f902 (patch) | |
tree | ec3d06ecb79cf2ed6a51a1ad7818bf22064afc38 /libsolidity/codegen/ExpressionCompiler.cpp | |
parent | a605e4eb957f65ab172015bd4f03ee56445a9f91 (diff) | |
download | dexon-solidity-af57879187b65bf1deebd96ba80d08bd10f2f902.tar dexon-solidity-af57879187b65bf1deebd96ba80d08bd10f2f902.tar.gz dexon-solidity-af57879187b65bf1deebd96ba80d08bd10f2f902.tar.bz2 dexon-solidity-af57879187b65bf1deebd96ba80d08bd10f2f902.tar.lz dexon-solidity-af57879187b65bf1deebd96ba80d08bd10f2f902.tar.xz dexon-solidity-af57879187b65bf1deebd96ba80d08bd10f2f902.tar.zst dexon-solidity-af57879187b65bf1deebd96ba80d08bd10f2f902.zip |
Report location on stack too deep if possible
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 82518e8c..8a28b454 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -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); } |