From 938b6dfd1cb5173aa6ab19aa848ae266dba0afff Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sat, 25 Jan 2020 15:52:31 +0100 Subject: issue #7527: Doxygen 1.8.17: regression of C macro expansion --- src/pre.l | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/pre.l b/src/pre.l index a26c044..4fafe40 100644 --- a/src/pre.l +++ b/src/pre.l @@ -2379,6 +2379,8 @@ static int getNextId(const QCString &expr,int p,int *l) return -1; } +#define MAX_EXPANSION_DEPTH 50 + /*! performs recursive macro expansion on the string \a expr * starting at position \a pos. * May read additional characters from the input while re-scanning! @@ -2392,7 +2394,7 @@ static bool expandExpression(yyscan_t yyscanner,QCString &expr,QCString *rest,in //printf("expansionDict.find(expr)!=0) // check for recursive expansions + if (state->expansionDict.find(expr)!=0 && level>MAX_EXPANSION_DEPTH) // check for too deep recursive expansions { //printf("MAX_EXPANSION_DEPTH) + { + break; + } } else // no re-scan marker found, skip the macro name { -- cgit v0.12