From a16e387dff863b5767104cfa724e7f8a240a1f57 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 24 Mar 2022 18:00:00 +0100 Subject: [PATCH] patterns: Fixed copying of type decl nodes --- .../hex/pattern_language/ast/ast_node_type_decl.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libimhex/include/hex/pattern_language/ast/ast_node_type_decl.hpp b/lib/libimhex/include/hex/pattern_language/ast/ast_node_type_decl.hpp index 35d4795f2..9922eddd8 100644 --- a/lib/libimhex/include/hex/pattern_language/ast/ast_node_type_decl.hpp +++ b/lib/libimhex/include/hex/pattern_language/ast/ast_node_type_decl.hpp @@ -8,15 +8,16 @@ namespace hex::pl { class ASTNodeTypeDecl : public ASTNode, public Attributable { public: - ASTNodeTypeDecl(std::string name) : m_forwardDeclared(true), m_name(name) { } + ASTNodeTypeDecl(std::string name) : m_forwardDeclared(true), m_name(std::move(name)) { } ASTNodeTypeDecl(std::string name, std::shared_ptr type, std::optional endian = std::nullopt) : ASTNode(), m_name(std::move(name)), m_type(std::move(type)), m_endian(endian) { } ASTNodeTypeDecl(const ASTNodeTypeDecl &other) : ASTNode(other), Attributable(other) { - this->m_name = other.m_name; - this->m_type = other.m_type; - this->m_endian = other.m_endian; + this->m_name = other.m_name; + this->m_type = other.m_type; + this->m_endian = other.m_endian; + this->m_forwardDeclared = other.m_forwardDeclared; } [[nodiscard]] std::unique_ptr clone() const override {