Skip to content
Snippets Groups Projects
Commit b3bb5d70 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS checks: Don't crash if try has no catch or finally.

Change-Id: If7001963bc11f2fa01f058c903ee014f6acb0c04
Reviewed-on: http://codereview.qt-project.org/5102


Reviewed-by: default avatarLeandro T. C. Melo <leandro.melo@nokia.com>
parent aebcc3c7
No related branches found
No related tags found
No related merge requests found
...@@ -371,8 +371,12 @@ protected: ...@@ -371,8 +371,12 @@ protected:
virtual bool visit(TryStatement *ast) virtual bool visit(TryStatement *ast)
{ {
State tryBody = check(ast->statement); State tryBody = check(ast->statement);
State catchBody = check(ast->catchExpression->statement); State catchBody = ReturnOrThrow;
State finallyBody = check(ast->finallyExpression->statement); if (ast->catchExpression)
catchBody = check(ast->catchExpression->statement);
State finallyBody = ReachesEnd;
if (ast->finallyExpression)
finallyBody = check(ast->finallyExpression->statement);
_state = qMax(qMin(tryBody, catchBody), finallyBody); _state = qMax(qMin(tryBody, catchBody), finallyBody);
return false; return false;
......
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