From d1df8b810f8067bf58f6381b487a471514505cb9 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 5 Nov 2014 18:44:05 +0100 Subject: Ignore break and continue outside of loops. --- Compiler.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Compiler.cpp') diff --git a/Compiler.cpp b/Compiler.cpp index 654ecead..d05552b9 100644 --- a/Compiler.cpp +++ b/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; } -- cgit v1.2.3