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

@@ -688,7 +688,7 @@ void lexer_CheckRecursionDepth(void)
size_t depth = 0;
for (struct Expansion *exp = lexerState->expansions; exp; exp = exp->parent) {
if (depth++ >= maxRecursionDepth)
if (depth++ > maxRecursionDepth)
fatalerror("Recursion limit (%zu) exceeded\n", maxRecursionDepth);
}
}
@@ -1336,7 +1336,7 @@ static int readIdentifier(char firstChar)
static char const *readInterpolation(size_t depth)
{
if (depth >= maxRecursionDepth)
if (depth > maxRecursionDepth)
fatalerror("Recursion limit (%zu) exceeded\n", maxRecursionDepth);
char symName[MAXSYMLEN + 1];