aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4jsir.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-03-14 10:17:27 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-19 08:14:53 +0100
commit44ca5f1be03420978cc8d5468c4c40dcd5174a06 (patch)
tree7d30284402d23fd448af568895a1753d64ab2a7a /src/qml/compiler/qv4jsir.cpp
parentcfd3eda076e81d56f985c830663ae93317b6ef8b (diff)
Enable constant propagation for all types
So far constant propagation was only enabled for numbers and booleans. Enable it for all types now and make sure the propagation does the right thing. Change-Id: I202b0073f463d8a42e34931a736544207284b6dc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4jsir.cpp')
-rw-r--r--src/qml/compiler/qv4jsir.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp
index d9d0742b68..a656f4dffe 100644
--- a/src/qml/compiler/qv4jsir.cpp
+++ b/src/qml/compiler/qv4jsir.cpp
@@ -745,7 +745,12 @@ Expr *BasicBlock::CONST(Type type, double value)
type = SInt32Type;
else
type = DoubleType;
+ } else if (type == NullType) {
+ value = 0;
+ } else if (type == UndefinedType) {
+ value = qSNaN();
}
+
e->init(type, value);
return e;
}