From c8966ca7017e92eaed1d908a591aa51f6d339bdd Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 9 Oct 2017 18:43:11 +0800 Subject: [PATCH] Regex: Assert that the regex direction matches the vm direction --- src/regex_impl.hh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/regex_impl.hh b/src/regex_impl.hh index 9dac1655..e4804433 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -109,9 +109,7 @@ public: ThreadedRegexVM(const CompiledRegex& program) : m_program{program} { - kak_assert(m_program); - if (direction != program.direction) - throw runtime_error{"Regex and VM direction mismatch"}; + kak_assert(m_program and direction == m_program.direction); } ThreadedRegexVM(const ThreadedRegexVM&) = delete;