diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2013-02-19 16:56:30 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-21 16:55:41 +0100 |
commit | b05f19f23217ebf982f021c71a04b1df73827c35 (patch) | |
tree | a4a4bb23e037ef98d5bc0b1bd1b2beec292d618d /src/tools/moc/preprocessor.h | |
parent | ec166aaa70d5451d84caf0a1ae984cacecd88d5b (diff) |
moc: Fix infinite recursion in macro substitution
When performing macro argument substitution, one should keep the set of
macro to exclude, else we can enter an infinite recursion.
Testcase:
#define M1(A) A
#define M2 M1(M2)
Task-number: QTBUG-29759
Change-Id: I564bbfed65e1c8599592eaf12c6d67285d2fd9ce
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src/tools/moc/preprocessor.h')
-rw-r--r-- | src/tools/moc/preprocessor.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/moc/preprocessor.h b/src/tools/moc/preprocessor.h index 55e452a2bd..72d02a3292 100644 --- a/src/tools/moc/preprocessor.h +++ b/src/tools/moc/preprocessor.h @@ -85,7 +85,8 @@ public: void substituteUntilNewline(Symbols &substituted); static Symbols macroExpandIdentifier(Preprocessor *that, SymbolStack &symbols, int lineNum, QByteArray *macroName); - static Symbols macroExpand(Preprocessor *that, Symbols &toExpand, int &index, int lineNum, bool one); + static Symbols macroExpand(Preprocessor *that, Symbols &toExpand, int &index, int lineNum, bool one, + const QSet<QByteArray> &excludeSymbols = QSet<QByteArray>()); int evaluateCondition(); |