C++: removed assert that could crash creator. Gracefully exit instead.

Change-Id: Iab79b2548195feb83b3f408f0eb612878454bd47
Reviewed-on: http://codereview.qt.nokia.com/4246
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
Erik Verbruggen
2011-09-06 10:44:23 +02:00
parent 1a4d13df5f
commit bb41c375b0

View File

@@ -71,7 +71,8 @@ bool ASTPath::preVisit(AST *ast)
unsigned lastToken = ast->lastToken();
if (firstToken > 0) {
Q_ASSERT(lastToken > firstToken);
if (lastToken <= firstToken)
return false;
unsigned startLine, startColumn;
getTokenStartPosition(firstToken, &startLine, &startColumn);