rgbasm -r sets the maximum recursion depth (#1026)

Previously it set the minimum failure depth (off by one)

Fixes #978
This commit is contained in:
Rangi
2022-08-28 15:21:29 -04:00
committed by GitHub
parent 425339ccf6
commit 7a2ee26792
11 changed files with 13 additions and 10 deletions

View File

@@ -37,7 +37,6 @@ struct Context {
static struct Context *contextStack;
static size_t contextDepth = 0;
#define DEFAULT_MAX_DEPTH 64
size_t maxRecursionDepth;
static unsigned int nbIncPaths = 0;
@@ -510,7 +509,7 @@ bool fstk_Break(void)
void fstk_NewRecursionDepth(size_t newDepth)
{
if (contextDepth >= newDepth)
if (contextDepth > newDepth)
fatalerror("Recursion limit (%zu) exceeded\n", newDepth);
maxRecursionDepth = newDepth;
}