From 76143252bab3bd41f97d9e8170f09ae35171ae71 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 1 Mar 2012 15:18:54 +0100 Subject: Remove non explicitly typed IR::CONST() nodes. This change ensures that IR::CONST expressions created by BasicBlock::BINOP(op,left,right) have the correct types. Change-Id: Iabac3f4ee1b897cc0d0bdf7e7385d7ae6dc513e4 Reviewed-by: Michael Brasser --- src/qml/qml/v4/qv4irbuilder.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/qml/qml/v4/qv4irbuilder.cpp') diff --git a/src/qml/qml/v4/qv4irbuilder.cpp b/src/qml/qml/v4/qv4irbuilder.cpp index 32581a072c..b382c262a8 100644 --- a/src/qml/qml/v4/qv4irbuilder.cpp +++ b/src/qml/qml/v4/qv4irbuilder.cpp @@ -531,7 +531,7 @@ bool QV4IRBuilder::visit(AST::NumericLiteral *ast) _expr.format = ExprResult::cx; _block->JUMP(ast->value ? _expr.iftrue : _expr.iffalse); } else { - _expr.code = _block->CONST(ast->value); + _expr.code = _block->CONST(IR::RealType, ast->value); } return false; } @@ -767,7 +767,7 @@ bool QV4IRBuilder::visit(AST::UnaryMinusExpression *ast) if (expr.isNot(IR::InvalidType)) { if (IR::Const *c = expr.code->asConst()) { _expr = expr; - _expr.code = _block->CONST(-c->value); + _expr.code = _block->CONST(expr->type, -c->value); return false; } @@ -785,7 +785,7 @@ bool QV4IRBuilder::visit(AST::TildeExpression *ast) if (expr.isNot(IR::InvalidType)) { if (IR::Const *c = expr.code->asConst()) { _expr = expr; - _expr.code = _block->CONST(~int(c->value)); + _expr.code = _block->CONST(expr->type, ~int(c->value)); return false; } IR::Expr *code = _block->UNOP(IR::OpCompl, expr); @@ -803,7 +803,7 @@ bool QV4IRBuilder::visit(AST::NotExpression *ast) if (expr.isNot(IR::InvalidType)) { if (IR::Const *c = expr.code->asConst()) { _expr = expr; - _expr.code = _block->CONST(!c->value); + _expr.code = _block->CONST(IR::BoolType, !c->value); return false; } @@ -862,7 +862,7 @@ bool QV4IRBuilder::visit(AST::BinaryExpression *ast) IR::Temp *r = _block->TEMP(IR::InvalidType); _block = iffalse; - _block->MOVE(r, _block->CONST(0)); // ### use the right null value + _block->MOVE(r, _block->CONST(IR::BoolType, 0)); // ### use the right null value _block->JUMP(endif); _block = iftrue; -- cgit v1.2.3