From f775d66844c6169034e954cdab5b54b1aedfb7f4 Mon Sep 17 00:00:00 2001 From: Aki <75532970+AkiSakurai@users.noreply.github.com> Date: Fri, 12 Dec 2025 21:30:12 +0800 Subject: [PATCH] evaluator: Clear template arguments at the beginning of evaluations As template arguments might contain references to local sections where the reference count is cleared at the beginning of the evaluation. --- lib/source/pl/core/evaluator.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/source/pl/core/evaluator.cpp b/lib/source/pl/core/evaluator.cpp index 28e3b49c..4c78c622 100644 --- a/lib/source/pl/core/evaluator.cpp +++ b/lib/source/pl/core/evaluator.cpp @@ -944,14 +944,19 @@ namespace pl::core { this->m_scopes.clear(); this->m_callStack.clear(); this->m_heap.clear(); - this->m_patternLocalStorage.clear(); + this->m_templateParameters.clear(); + this->m_currentTemplateArguments.clear(); + this->m_typeTemplateParameters.clear(); + this->m_attributedPatterns.clear(); + + this->m_patternLocalStorage.clear(); + this->m_stringPool.clear(); this->m_mainResult.reset(); this->m_aborted = false; this->m_evaluated = false; - this->m_attributedPatterns.clear(); this->setPatternColorPalette(DefaultPatternColorPalette);