diff --git a/plugins/libimhex/include/hex/lang/ast_node.hpp b/plugins/libimhex/include/hex/lang/ast_node.hpp index f988bf24d..0ea892c25 100644 --- a/plugins/libimhex/include/hex/lang/ast_node.hpp +++ b/plugins/libimhex/include/hex/lang/ast_node.hpp @@ -188,6 +188,7 @@ namespace hex::lang { ~ASTNodeVariableDecl() override { delete this->m_type; + delete this->m_placementOffset; } [[nodiscard]] ASTNode* clone() const override { @@ -226,6 +227,7 @@ namespace hex::lang { ~ASTNodeArrayVariableDecl() override { delete this->m_type; delete this->m_size; + delete this->m_placementOffset; } [[nodiscard]] ASTNode* clone() const override { @@ -262,6 +264,8 @@ namespace hex::lang { ~ASTNodePointerVariableDecl() override { delete this->m_type; + delete this->m_sizeType; + delete this->m_placementOffset; } [[nodiscard]] ASTNode* clone() const override { diff --git a/plugins/libimhex/include/hex/lang/pattern_data.hpp b/plugins/libimhex/include/hex/lang/pattern_data.hpp index de59262bd..fb0ffbea1 100644 --- a/plugins/libimhex/include/hex/lang/pattern_data.hpp +++ b/plugins/libimhex/include/hex/lang/pattern_data.hpp @@ -217,6 +217,10 @@ namespace hex::lang { this->m_pointedAt->setVariableName("*" + this->m_pointedAt->getVariableName()); } + ~PatternDataPointer() override { + delete this->m_pointedAt; + } + PatternData* clone() override { return new PatternDataPointer(*this); } @@ -453,6 +457,11 @@ namespace hex::lang { this->m_entries.push_back(entry->clone()); } + ~PatternDataArray() override { + for (const auto &entry : this->m_entries) + delete entry; + } + PatternData* clone() override { return new PatternDataArray(*this); } @@ -528,6 +537,11 @@ namespace hex::lang { this->m_members.push_back(member->clone()); } + ~PatternDataStruct() override { + for (const auto &member : this->m_members) + delete member; + } + PatternData* clone() override { return new PatternDataStruct(*this); } @@ -609,6 +623,11 @@ namespace hex::lang { this->m_members.push_back(member->clone()); } + ~PatternDataUnion() override { + for (const auto &member : this->m_members) + delete member; + } + PatternData* clone() override { return new PatternDataUnion(*this); }