aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v4/qv4irbuilder.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2012-03-01 15:18:54 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-09 09:52:14 +0100
commit76143252bab3bd41f97d9e8170f09ae35171ae71 (patch)
treee4238884e0eacbcd4d281234a2a1a4845b0e59d7 /src/qml/qml/v4/qv4irbuilder.cpp
parent5c7b17379d2c24d83903ee00a3170d58332a79db (diff)
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 <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/v4/qv4irbuilder.cpp')
-rw-r--r--src/qml/qml/v4/qv4irbuilder.cpp10
1 files changed, 5 insertions, 5 deletions
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;