summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-05-07 15:34:58 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-09 20:47:42 +0000
commit2fc50421c86134b5b42a4ba68aa7f6b87cfd7d74 (patch)
treedd6ddf7f16a058af35fe61ac6e77fad9c6460613 /src
parent01883b6910a6c85e7061b2936aa890da544b1060 (diff)
downloadqtdeclarative-2fc50421c86134b5b42a4ba68aa7f6b87cfd7d74.tar.gz
Don't cast an ExpressionNode to a Statement
Change-Id: Ieb30d5345e56d6a2bb70320bf76eabcb9457e0f3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qv4codegen.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 3543ddb177..837649a7dc 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -358,10 +358,10 @@ void Codegen::statementList(StatementList *ast)
it->next->statement->kind == Statement::Kind_ContinueStatement ||
it->next->statement->kind == Statement::Kind_ReturnStatement)
requiresReturnValue = _requiresReturnValue;
- if (FunctionDeclaration *decl = cast<FunctionDeclaration *>(it->statement))
- statement(decl);
+ if (Statement *s = it->statement->statementCast())
+ statement(s);
else
- statement(static_cast<Statement *>(it->statement));
+ statement(static_cast<ExpressionNode *>(it->statement));
requiresReturnValue = false;
if (it->statement->kind == Statement::Kind_ThrowStatement ||
it->statement->kind == Statement::Kind_BreakStatement ||