forked from qt-creator/qt-creator
MacroExpander: Prevent loop with subproviders
Prevent a loop where a subprovider of a macroexpander creates the macroexpander itself. Change-Id: Id2f3e29651aeb22c818091d8c785a6ea01545463 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <QDir>
|
||||
#include <QRegularExpression>
|
||||
#include <QSet>
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
@@ -153,7 +154,8 @@ bool AbstractMacroExpander::expandNestedMacros(const QString &str, int *pos, QSt
|
||||
*pos = i;
|
||||
return true;
|
||||
}
|
||||
if (resolveMacro(varName, ret)) {
|
||||
QSet<AbstractMacroExpander*> seen;
|
||||
if (resolveMacro(varName, ret, seen)) {
|
||||
*pos = i;
|
||||
if (!pattern.isEmpty() && currArg == &replace) {
|
||||
const QRegularExpression regexp(pattern);
|
||||
|
||||
Reference in New Issue
Block a user