diff options
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index d13ef1bc86..f7c4e2c98f 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -1536,6 +1536,7 @@ bool Codegen::visit(BinaryExpression *ast) // intentional fall-through! case QSOperator::In: case QSOperator::InstanceOf: + case QSOperator::As: case QSOperator::Equal: case QSOperator::NotEqual: case QSOperator::Ge: @@ -1568,9 +1569,6 @@ bool Codegen::visit(BinaryExpression *ast) break; } - case QSOperator::As: - setExprResult(left); - break; } // switch return false; @@ -1734,6 +1732,14 @@ Codegen::Reference Codegen::binopHelper(QSOperator::Op oper, Reference &left, Re bytecodeGenerator->addInstruction(binop); break; } + case QSOperator::As: { + Instruction::As as; + left = left.storeOnStack(); + right.loadInAccumulator(); + as.lhs = left.stackSlot(); + bytecodeGenerator->addInstruction(as); + break; + } case QSOperator::In: { Instruction::CmpIn binop; left = left.storeOnStack(); |