diff --git a/plugins/libimhex/include/hex/pattern_language/ast_node.hpp b/plugins/libimhex/include/hex/pattern_language/ast_node.hpp index f3bd9192e..fc8e8e4b6 100644 --- a/plugins/libimhex/include/hex/pattern_language/ast_node.hpp +++ b/plugins/libimhex/include/hex/pattern_language/ast_node.hpp @@ -1647,9 +1647,9 @@ namespace hex::pl { LogConsole::abortEvaluation("array index out of bounds", this); auto newPattern = searchScope.front()->clone(); + newPattern->setOffset(staticArrayPattern->getOffset() + index * staticArrayPattern->getTemplate()->getSize()); delete currPattern; currPattern = newPattern; - currPattern->setOffset(staticArrayPattern->getOffset() + index * staticArrayPattern->getSize()); } } }, index->getValue());