From e50b7c92998905efdd40314724480e3070bdbcb5 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 5 May 2011 17:19:01 +0200 Subject: Fix evaluation of boolean conditions Ensure that the operand of IR::OpIfTrue and IR::OpNot has boolean type. --- src/declarative/qml/v4/qdeclarativev4compiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/declarative/qml/v4/qdeclarativev4compiler.cpp b/src/declarative/qml/v4/qdeclarativev4compiler.cpp index a7eecce0c9..e67a3821d7 100644 --- a/src/declarative/qml/v4/qdeclarativev4compiler.cpp +++ b/src/declarative/qml/v4/qdeclarativev4compiler.cpp @@ -404,15 +404,15 @@ void QDeclarativeV4CompilerPrivate::visitUnop(IR::Unop *e) break; case IR::OpIfTrue: + convertToBool(e->expr, src); if (src != currentReg) { i.move_reg_reg(currentReg, src); gen(i); - } else { - // nothing to do } break; case IR::OpNot: + convertToBool(e->expr, src); i.unary_not(currentReg, src); gen(i); break; -- cgit v1.2.3