diff --git a/lib/libimhex/include/hex/pattern_language/ast_node.hpp b/lib/libimhex/include/hex/pattern_language/ast_node.hpp index 535b0d1d8..6a913a48d 100644 --- a/lib/libimhex/include/hex/pattern_language/ast_node.hpp +++ b/lib/libimhex/include/hex/pattern_language/ast_node.hpp @@ -1556,7 +1556,14 @@ namespace hex::pl { explicit ASTNodeRValue(Path path) : ASTNode(), m_path(std::move(path)) { } - ASTNodeRValue(const ASTNodeRValue &) = default; + ASTNodeRValue(const ASTNodeRValue &other) { + for (auto &part : other.m_path) { + if (auto stringPart = std::get_if(&part); stringPart != nullptr) + this->m_path.push_back(*stringPart); + else if (auto nodePart = std::get_if(&part); nodePart != nullptr) + this->m_path.push_back((*nodePart)->clone()); + } + } ~ASTNodeRValue() override { for (auto &part : this->m_path) {