aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ContractCompiler.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-06-12 07:46:23 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-06-12 07:46:23 +0800
commit1d57d74e82ffc032da2ce3289d878f2eee29b1b2 (patch)
tree1d4ff197bb328e74201a30e21e7f05550206d6a7 /libsolidity/codegen/ContractCompiler.cpp
parent8999a2f375410a29bae46b8e87a70c62036c880d (diff)
downloaddexon-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/ContractCompiler.cpp')
-rw-r--r--libsolidity/codegen/ContractCompiler.cpp8
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;
}