From a5274daeaa6042fc950d487acfae492fd19b20ae Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 10 Sep 2021 22:12:37 +0200 Subject: [PATCH] patterns: Fixed padding not padding --- plugins/libimhex/source/pattern_language/evaluator.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/plugins/libimhex/source/pattern_language/evaluator.cpp b/plugins/libimhex/source/pattern_language/evaluator.cpp index 96663c0d0..b60b735bc 100644 --- a/plugins/libimhex/source/pattern_language/evaluator.cpp +++ b/plugins/libimhex/source/pattern_language/evaluator.cpp @@ -1079,18 +1079,13 @@ namespace hex::pl { if (arraySize < 0) this->getConsole().abortEvaluation("array size cannot be negative"); - if (auto typeDecl = dynamic_cast(node->getType()); typeDecl != nullptr) { - if (auto builtinType = dynamic_cast(typeDecl->getType()); builtinType != nullptr) { - if (builtinType->getType() == Token::ValueType::Padding) - return new PatternDataPadding(startOffset, entrySize * arraySize); - } - } - PatternData *pattern; if (dynamic_cast(templatePattern) != nullptr) pattern = new PatternDataString(startOffset, entrySize * arraySize, color.value_or(0)); else if (dynamic_cast(templatePattern) != nullptr) pattern = new PatternDataString16(startOffset, entrySize * arraySize, color.value_or(0)); + else if (dynamic_cast(templatePattern) != nullptr) + pattern = new PatternDataPadding(startOffset, entrySize * arraySize); else { auto arrayPattern = new PatternDataStaticArray(startOffset, entrySize * arraySize, color.value_or(0)); arrayPattern->setTypeName(templatePattern->getTypeName());