From e8dec2a12b9bf3e1cad74c7387ad9a23c42e64d9 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 16 Apr 2018 10:56:52 +0200 Subject: 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 --- src/qml/jsruntime/qv4object.cpp | 4 +--- 1 file changed, 1 insertion(+), 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; -- cgit v1.2.3