aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4sequenceobject.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-12-06 18:49:39 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-12-09 10:46:24 +0100
commitfb54af6638dcbeae8ad21249fe234ef4d82c005b (patch)
tree03ac64a2d9f52da8b27be578325409c1933731bc /src/qml/jsruntime/qv4sequenceobject.cpp
parentd5dc3c4cbdc4455143626d7a3e0f9a9a211515a9 (diff)
qv4sequenceobject.cpp: Use operator[] rather than at()
at() does a range check on the argument. There is no reason to do this here, and for std::vector this can trigger an exception with interesting compiler bugs attached to it. Task-number: QTBUG-80535 Change-Id: I186262de89074a93e68cacec4fba31cc8b8108c8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4sequenceobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4sequenceobject.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp
index 7caa122698..433c65cbbf 100644
--- a/src/qml/jsruntime/qv4sequenceobject.cpp
+++ b/src/qml/jsruntime/qv4sequenceobject.cpp
@@ -369,8 +369,11 @@ public:
++arrayIndex;
if (attrs)
*attrs = QV4::Attr_Data;
+
+ // TODO: remove conflicting comment when merged in from 5.14
+
if (pd)
- pd->value = convertElementToValue(s->engine(), s->d()->container->at(index));
+ pd->value = convertElementToValue(s->engine(), (*s->d()->container)[index]);
return PropertyKey::fromArrayIndex(index);
}