aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-04-16 10:56:52 +0200
committerAapo Keskimolo <aapo.keskimolo@qt.io>2018-04-16 17:52:21 +0000
commite8dec2a12b9bf3e1cad74c7387ad9a23c42e64d9 (patch)
tree53870457d85a727fee901b22c4a0e02528963a38
parent685a267d37b5a13ed357d6c03953096d6b88907b (diff)
Remove a bogus assert
It's actually possible to have oldLength != 0 and no arrayData in this code path if someone redefines the length property of the JS array. Change-Id: Ib699425b95fa1e1981483ccb2b2babd476b86f60 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/qml/jsruntime/qv4object.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index 8e9bf794a9..bcbe475c2c 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -1091,9 +1091,7 @@ bool Object::setArrayLength(uint newLen)
uint oldLen = getLength();
bool ok = true;
if (newLen < oldLen) {
- if (!arrayData()) {
- Q_ASSERT(!newLen);
- } else {
+ if (arrayData()) {
uint l = arrayData()->vtable()->truncate(this, newLen);
if (l != newLen)
ok = false;