From c9cd7ad4a6bd105f3dc4ce568d2117ca80441971 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 19 Oct 2023 23:34:05 +0200 Subject: [PATCH] fix: Data processor recursion detector triggering too soon --- lib/libimhex/include/hex/data_processor/node.hpp | 4 ++++ lib/libimhex/source/data_processor/node.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib/libimhex/include/hex/data_processor/node.hpp b/lib/libimhex/include/hex/data_processor/node.hpp index cdfa202d1..168e11581 100644 --- a/lib/libimhex/include/hex/data_processor/node.hpp +++ b/lib/libimhex/include/hex/data_processor/node.hpp @@ -109,6 +109,10 @@ namespace hex::dp { throwNodeError("Recursion detected!"); } + void unmarkInputProcessed(u32 index) { + this->m_processedInputs.erase(index); + } + protected: [[noreturn]] void throwNodeError(const std::string &message) { throw NodeError { this, message }; diff --git a/lib/libimhex/source/data_processor/node.cpp b/lib/libimhex/source/data_processor/node.cpp index fb5a2dc72..a636631ef 100644 --- a/lib/libimhex/source/data_processor/node.cpp +++ b/lib/libimhex/source/data_processor/node.cpp @@ -29,6 +29,7 @@ namespace hex::dp { markInputProcessed(index); attribute->getParentNode()->process(); + unmarkInputProcessed(index); auto &outputData = attribute->getOutputData(); @@ -48,6 +49,7 @@ namespace hex::dp { markInputProcessed(index); attribute->getParentNode()->process(); + unmarkInputProcessed(index); return attribute->getOutputData(); } else { @@ -74,6 +76,7 @@ namespace hex::dp { markInputProcessed(index); attribute->getParentNode()->process(); + unmarkInputProcessed(index); return attribute->getOutputData(); } else {