expansionOfs cannot be negative

lexerState->expansionOfs is always either set to 0, or updated by
adding a positive quantity:

    if (distance > lexerState->expansions->distance) {
        lexerState->expansionOfs += distance - lexerState->expansions->distance;
        ...
    }

so it will always be positive or zero.
This commit is contained in:
Rangi
2021-04-15 18:38:50 -04:00
committed by Eldred Habert
parent eba06404f0
commit f69e666b00

View File

@@ -364,7 +364,7 @@ struct LexerState {
size_t macroArgScanDistance; /* Max distance already scanned for macro args */ size_t macroArgScanDistance; /* Max distance already scanned for macro args */
bool expandStrings; bool expandStrings;
struct Expansion *expansions; struct Expansion *expansions;
size_t expansionOfs; /* Offset into the current top-level expansion (negative = before) */ size_t expansionOfs; /* Offset into the current top-level expansion */
}; };
struct LexerState *lexerState = NULL; struct LexerState *lexerState = NULL;