fixed push_deadstack in the root

This commit is contained in:
Zeno Rogue 2021-08-17 17:24:11 +02:00
parent 4c3800f2b4
commit c97290890e
1 changed files with 3 additions and 0 deletions

View File

@ -1122,8 +1122,11 @@ void push_deadstack(vector<tsinfo>& 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);