aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-06-01 14:25:32 +0200
committerLars Knoll <lars.knoll@digia.com>2013-06-02 15:11:46 +0200
commit2fae41a4e0376d93ceeeedd5e0014fab91473c23 (patch)
tree1f464cbae3127fa8c1904cb610fcff9dead011e7 /src/qml/qml/qqmljavascriptexpression.cpp
parent4b63f9b2344213cd96622e9c0929011d252f1714 (diff)
Fix uninitialized return value for QQmlJavaScriptExpression::evaluate
In case of an exception, we'd return an uninitialized value. (visible when running tst_qqmlecmascript in valgrind) Change-Id: I2c95a112b09ba527e61088904fa7daff003be05d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 1d4bba66d2..863432bcc0 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -154,7 +154,7 @@ QQmlJavaScriptExpression::evaluate(QQmlContextData *context,
// incase we have been deleted.
DeleteWatcher watcher(this);
- QV4::Value result;
+ QV4::Value result = QV4::Value::undefinedValue();
QV4::ExecutionEngine *v4 = QV8Engine::getV4(ep->v8engine());
QV4::ExecutionContext *ctx = v4->current;
try {