diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-12 07:46:23 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-12 07:46:23 +0800 |
commit | 1d57d74e82ffc032da2ce3289d878f2eee29b1b2 (patch) | |
tree | 1d4ff197bb328e74201a30e21e7f05550206d6a7 /libsolidity/codegen | |
parent | 8999a2f375410a29bae46b8e87a70c62036c880d (diff) | |
download | dexon-solidity-1d57d74e82ffc032da2ce3289d878f2eee29b1b2.tar.gz dexon-solidity-1d57d74e82ffc032da2ce3289d878f2eee29b1b2.tar.zst dexon-solidity-1d57d74e82ffc032da2ce3289d878f2eee29b1b2.zip |
Fail if break/continue statements are used outside for/while loops in ContractCompiler
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index f195b416..81aba21e 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -749,16 +749,16 @@ bool ContractCompiler::visit(ForStatement const& _forStatement) bool ContractCompiler::visit(Continue const& _continueStatement) { CompilerContext::LocationSetter locationSetter(m_context, _continueStatement); - if (!m_continueTags.empty()) - m_context.appendJumpTo(m_continueTags.back()); + solAssert(!m_continueTags.empty(), ""); + m_context.appendJumpTo(m_continueTags.back()); return false; } bool ContractCompiler::visit(Break const& _breakStatement) { CompilerContext::LocationSetter locationSetter(m_context, _breakStatement); - if (!m_breakTags.empty()) - m_context.appendJumpTo(m_breakTags.back()); + solAssert(!m_breakTags.empty(), ""); + m_context.appendJumpTo(m_breakTags.back()); return false; } |