From cc59b36c540d228da07ff811495c1e4ce01cceab Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 1 Mar 2022 20:57:21 +0100 Subject: [PATCH] patterns: Properly reset back current control flow type in arrays Fixes issue mentioned in #460 --- .../hex/pattern_language/ast/ast_node_array_variable_decl.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libimhex/include/hex/pattern_language/ast/ast_node_array_variable_decl.hpp b/lib/libimhex/include/hex/pattern_language/ast/ast_node_array_variable_decl.hpp index 1ed2739a9..5c76f6d67 100644 --- a/lib/libimhex/include/hex/pattern_language/ast/ast_node_array_variable_decl.hpp +++ b/lib/libimhex/include/hex/pattern_language/ast/ast_node_array_variable_decl.hpp @@ -215,6 +215,7 @@ namespace hex::pl { addEntries(std::move(patterns)); auto ctrlFlow = evaluator->getCurrentControlFlowStatement(); + evaluator->setCurrentControlFlowStatement(ControlFlowStatement::None); if (ctrlFlow == ControlFlowStatement::Break) break; else if (ctrlFlow == ControlFlowStatement::Continue) { @@ -238,6 +239,7 @@ namespace hex::pl { addEntries(std::move(patterns)); auto ctrlFlow = evaluator->getCurrentControlFlowStatement(); + evaluator->setCurrentControlFlowStatement(ControlFlowStatement::None); if (ctrlFlow == ControlFlowStatement::Break) break; else if (ctrlFlow == ControlFlowStatement::Continue) { @@ -284,6 +286,7 @@ namespace hex::pl { } auto ctrlFlow = evaluator->getCurrentControlFlowStatement(); + evaluator->setCurrentControlFlowStatement(ControlFlowStatement::None); if (ctrlFlow == ControlFlowStatement::Break) break; else if (ctrlFlow == ControlFlowStatement::Continue) {