From c97290890e0c647a9ca04265d8d13ea305ff924d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 17 Aug 2021 17:24:11 +0200 Subject: [PATCH] fixed push_deadstack in the root --- rulegen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rulegen.cpp b/rulegen.cpp index a1edfb76..3f5d52d0 100644 --- a/rulegen.cpp +++ b/rulegen.cpp @@ -1122,8 +1122,11 @@ void push_deadstack(vector& hash, twalker w, tsinfo tsi, int dir) { hash.push_back(tsi); while(true) { + ufind(w); + if(isize(hash) > 10000) throw rulegen_failure("deadstack overflow"); tsi.second += dir; w += dir; auto& ts = treestates[tsi.first]; + if(ts.is_root) return; if(tsi.second == 0 || tsi.second == isize(ts.rules)) { w += wstep; tsi = get_tsinfo(w);