summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc/tst_moc.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2016-07-19 12:48:10 +0200
committerThiago Macieira <thiago.macieira@intel.com>2016-07-20 06:56:40 +0000
commitaf055964f57dfccc76663bbf8e96b90d0fee984c (patch)
tree208d7ae13d6188575f63df416c4ad73ce9fecd16 /tests/auto/tools/moc/tst_moc.cpp
parentaf6f7179e8faf890d7845a68560732f46275e105 (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 'tests/auto/tools/moc/tst_moc.cpp')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 9d2b883112..7f73e8f23d 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -1942,6 +1942,13 @@ void tst_Moc::warnings_data()
<< 1
<< QString("IGNORE_ALL_STDOUT")
<< QString(":-1: Error: Unexpected character in macro argument list.");
+
+ QTest::newRow("QTBUG-54815: Crash on invalid input")
+ << QByteArray("class M{(})F<{}d000000000000000#0")
+ << QStringList()
+ << 0
+ << QString()
+ << QString("standard input:1: Note: No relevant classes found. No output generated.");
}
void tst_Moc::warnings()