From d5ca4c4f28cf287bef54d8272abb3bdd830cb2e3 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 27 Sep 2021 20:16:23 +0200 Subject: [PATCH] patterns: Fixed pointer name displaying --- plugins/libimhex/include/hex/pattern_language/ast_node.hpp | 4 ++-- .../libimhex/include/hex/pattern_language/pattern_data.hpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/libimhex/include/hex/pattern_language/ast_node.hpp b/plugins/libimhex/include/hex/pattern_language/ast_node.hpp index 8c7715d81..acd62f896 100644 --- a/plugins/libimhex/include/hex/pattern_language/ast_node.hpp +++ b/plugins/libimhex/include/hex/pattern_language/ast_node.hpp @@ -987,6 +987,8 @@ namespace hex::pl { ON_SCOPE_EXIT { delete sizePattern; }; auto pattern = new PatternDataPointer(offset, sizePattern->getSize()); + pattern->setVariableName(this->m_name); + offset = evaluator->dataOffset(); { @@ -1001,8 +1003,6 @@ namespace hex::pl { evaluator->dataOffset() = offset; - pattern->setVariableName(this->m_name); - applyVariableAttributes(evaluator, this, pattern); return { pattern }; diff --git a/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp b/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp index 74414488f..bd83863f6 100644 --- a/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp +++ b/plugins/libimhex/include/hex/pattern_language/pattern_data.hpp @@ -391,6 +391,7 @@ namespace hex::pl { void setPointedAtPattern(PatternData *pattern) { this->m_pointedAt = pattern; + this->m_pointedAt->setVariableName(hex::format("*({})", this->getVariableName())); } [[nodiscard]] PatternData* getPointedAtPattern() {