Skip to content
Snippets Groups Projects
Commit bb41c375 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

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

Change-Id: Iab79b2548195feb83b3f408f0eb612878454bd47
Reviewed-on: http://codereview.qt.nokia.com/4246


Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarChristian Kamm <christian.d.kamm@nokia.com>
parent 1a4d13df
No related branches found
No related tags found
No related merge requests found
...@@ -71,7 +71,8 @@ bool ASTPath::preVisit(AST *ast) ...@@ -71,7 +71,8 @@ bool ASTPath::preVisit(AST *ast)
unsigned lastToken = ast->lastToken(); unsigned lastToken = ast->lastToken();
if (firstToken > 0) { if (firstToken > 0) {
Q_ASSERT(lastToken > firstToken); if (lastToken <= firstToken)
return false;
unsigned startLine, startColumn; unsigned startLine, startColumn;
getTokenStartPosition(firstToken, &startLine, &startColumn); getTokenStartPosition(firstToken, &startLine, &startColumn);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment