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:
Tobias Hunger
2017-06-07 16:50:04 +02:00
parent ba8e7d1156
commit 4e96f2ce22
3 changed files with 16 additions and 7 deletions

View File

@@ -65,7 +65,7 @@ public:
//! \param name The name of the expando
//! \param ret Replacement string on output
//! \return True if the expando was found
virtual bool resolveMacro(const QString &name, QString *ret) = 0;
virtual bool resolveMacro(const QString &name, QString *ret, QSet<AbstractMacroExpander *> &seen) = 0;
private:
bool expandNestedMacros(const QString &str, int *pos, QString *ret);
};