@@ -929,25 +929,27 @@ namespace pl::core {
929929 }
930930
931931 void Evaluator::pushSectionId (u64 id) {
932- this ->m_sectionIdStack .push_back (id);
932+ this ->getRuntime (). m_sectionData -> sectionIdStack .push_back (id);
933933 }
934934
935935 void Evaluator::popSectionId () {
936- this ->m_sectionIdStack .pop_back ();
936+ this ->getRuntime (). m_sectionData -> sectionIdStack .pop_back ();
937937 }
938938
939939 [[nodiscard]] u64 Evaluator::getSectionId () const {
940- if (this ->m_sectionIdStack .empty ())
940+ const auto §ionIdStack = this ->getRuntime ().m_sectionData ->sectionIdStack ;
941+ if (sectionIdStack.empty ())
941942 return 0 ;
942943
943- return this -> m_sectionIdStack .back ();
944+ return sectionIdStack .back ();
944945 }
945946
946947 u64 Evaluator::getUserSectionId () const {
947- if (this ->m_sectionIdStack .empty ())
948+ const auto §ionIdStack = this ->getRuntime ().m_sectionData ->sectionIdStack ;
949+ if (sectionIdStack.empty ())
948950 return 0 ;
949951
950- for (auto it = this -> m_sectionIdStack .rbegin (); it != this -> m_sectionIdStack .rend (); ++it) {
952+ for (auto it = sectionIdStack .rbegin (); it != sectionIdStack .rend (); ++it) {
951953 if (*it != ptrn::Pattern::MainSectionId && *it != ptrn::Pattern::HeapSectionId && *it != ptrn::Pattern::PatternLocalSectionId && *it != ptrn::Pattern::InstantiationSectionId)
952954 return *it;
953955 }
@@ -959,7 +961,6 @@ namespace pl::core {
959961 this ->m_readOrderReversed = false ;
960962 this ->m_currBitOffset = 0 ;
961963
962- this ->m_sectionIdStack .clear ();
963964 this ->m_outVariables .clear ();
964965 this ->m_outVariableValues .clear ();
965966
@@ -978,6 +979,8 @@ namespace pl::core {
978979 this ->m_evaluated = false ;
979980 this ->m_attributedPatterns .clear ();
980981
982+ this ->m_subRuntimes .clear ();
983+
981984 this ->setPatternColorPalette (DefaultPatternColorPalette);
982985
983986 if (this ->m_allowDangerousFunctions == DangerousFunctionPermission::Deny)
0 commit comments