From 2b0f02aa5cc0f7d1b460d2d324d5d08c6f6d61b9 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 13 Feb 2014 11:13:30 +0100 Subject: moc: Fix parsing of operator< MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit moc would skip the 'operator' keyword as unknown and try to parse a type again but as it sees the '<' it looks for the corresponding '>' which does not exist types can't start with '<' anyway, so return an invalid type and continue parsing as usual Task-number: QTBUG-36834 Change-Id: If3d27076ef9947abf8c57c594713eece9334d0b0 Reviewed-by: Simon Hausmann Reviewed-by: Jędrzej Nowacki --- src/tools/moc/moc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 22cbb97364..b26fac5dcf 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -224,6 +224,10 @@ Type Moc::parseType() ; } if (test(LANGLE)) { + if (type.name.isEmpty()) { + // '<' cannot start a type + return type; + } type.name += lexemUntil(RANGLE); } if (test(SCOPE)) { -- cgit v1.2.3