--- parser3/src/include/pa_request.h 2026/09/25 12:55:42 1.274 +++ parser3/src/include/pa_request.h 2026/09/26 19:06:55 1.277 @@ -8,7 +8,7 @@ #ifndef PA_REQUEST_H #define PA_REQUEST_H -#define IDENT_PA_REQUEST_H "$Id: pa_request.h,v 1.274 2026/09/25 12:55:42 moko Exp $" +#define IDENT_PA_REQUEST_H "$Id: pa_request.h,v 1.277 2026/09/26 19:06:55 moko Exp $" #include "pa_pool.h" #include "pa_hash.h" @@ -128,7 +128,10 @@ private: return fsize==fbottom; } - Table &table(Request &r, const String* problem_source); + Table &table(Request &r, const String* problem_source) { + return table(r, problem_source, bottom_index(), top_index()); + } + Table &table(Request &r, const String* problem_source, size_t bottom, size_t top); }; ///@{ core data @@ -144,6 +147,8 @@ private: /// endless execute(execute(... preventing counter int anti_endless_execute_recursion; + int execute_recursion_limit; + void recursion_limit_reached(); ///@} @@ -240,14 +245,18 @@ public: /// execute ops with anti-recursion check void recursion_checked_execute(ArrayOperation& ops) { - if(++anti_endless_execute_recursion>=pa_execute_recursion_limit) { - anti_endless_execute_recursion=0; // give @exception a chance - throw Exception(PARSER_RUNTIME, 0, "call canceled - endless recursion detected"); - } + if(++anti_endless_execute_recursion>=execute_recursion_limit) + recursion_limit_reached(); execute(ops); // execute it anti_endless_execute_recursion--; } + /// take the recovery reserve back if recursion limit is far enough + void recursion_limit_try_restore() { + if(execute_recursion_limit>pa_execute_recursion_limit && anti_endless_execute_recursion