mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Restore blue-painting of macro arg expansions to prevent recursion
This commit is contained in:
@@ -817,6 +817,11 @@ static int peek() {
|
||||
shiftChar();
|
||||
if (std::shared_ptr<std::string> str = readMacroArg(); str) {
|
||||
beginExpansion(str, std::nullopt);
|
||||
|
||||
// Mark the entire macro arg expansion as "painted blue"
|
||||
// so that macro args can't be recursive
|
||||
// https://en.wikipedia.org/wiki/Painted_blue
|
||||
lexerState->macroArgScanDistance += str->length();
|
||||
}
|
||||
} else if (c == '{' && !lexerState->disableInterpolation) {
|
||||
// If character is an open brace, do symbol interpolation
|
||||
|
||||
Reference in New Issue
Block a user