diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2016-07-19 12:48:10 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-07-20 06:56:40 +0000 |
commit | af055964f57dfccc76663bbf8e96b90d0fee984c (patch) | |
tree | 208d7ae13d6188575f63df416c4ad73ce9fecd16 /src | |
parent | af6f7179e8faf890d7845a68560732f46275e105 (diff) |
moc: fix infinite loop over malformed input
We should not call prev() if we had already reched the end.
Task-number: QTBUG-54815
Change-Id: I56bc86880a0dbfdce57fc4a08e5950f2ff3a5958
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/moc/moc.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 7dd94cdca7..5534cdd6b8 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com> ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the tools applications of the Qt Toolkit. @@ -184,6 +185,8 @@ Type Moc::parseType() case Q_SLOT_TOKEN: type.name += lexem(); return type; + case NOTOKEN: + return type; default: prev(); break; @@ -218,6 +221,8 @@ Type Moc::parseType() type.name += lexem(); isVoid |= (lookup(0) == VOID); break; + case NOTOKEN: + return type; default: prev(); ; |