mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Ignore break and continue outside of loops.
This commit is contained in:
parent
e30d3f8d53
commit
d1df8b810f
10
Compiler.cpp
10
Compiler.cpp
@ -252,17 +252,15 @@ bool Compiler::visit(WhileStatement& _whileStatement)
|
||||
|
||||
bool Compiler::visit(Continue&)
|
||||
{
|
||||
if (asserts(!m_continueTags.empty()))
|
||||
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Jump tag not available for \"continue\"."));
|
||||
m_context.appendJumpTo(m_continueTags.back());
|
||||
if (!m_continueTags.empty())
|
||||
m_context.appendJumpTo(m_continueTags.back());
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Compiler::visit(Break&)
|
||||
{
|
||||
if (asserts(!m_breakTags.empty()))
|
||||
BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Jump tag not available for \"break\"."));
|
||||
m_context.appendJumpTo(m_breakTags.back());
|
||||
if (!m_breakTags.empty())
|
||||
m_context.appendJumpTo(m_breakTags.back());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user