From d9fe0f3667e940f5313dbdb94f8247125106ee0d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 6 Dec 2019 18:43:34 +0100 Subject: qv4sequenceobject.cpp: Add "here be dragons" comment No one should remove this at() before Qt6. Task-number: QTBUG-80535 Change-Id: I464c6f675dc68ad9762fcb594bb4d6ba6bdaf316 Reviewed-by: Fabian Kosmale --- src/qml/jsruntime/qv4sequenceobject.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/qml/jsruntime/qv4sequenceobject.cpp') diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index 77a98247ac..5055e13223 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -375,6 +375,22 @@ public: ++arrayIndex; if (attrs) *attrs = QV4::Attr_Data; + + // TODO: Replace the container->at() below with operator[] in Qt6! + // TODO: But _not_ in Qt5! + // + // gcc 5.3.1 as shipped on RHEL 7.6 includes a copy of basic_string + // into QtQml, when it sees a std::vector::at(). The basic_string symbols + // are publicly visible and preferred over the ones from libstdc++ when + // building user code. Therefore, removing this at() breaks binary + // compatibility. We _do_ want to remove it in Qt6, though. + // + // The exact mechanism is that at() checks its argument and can throw an + // out_of_range exception. The construction of this exception then triggers + // some string manipulation that uses the std::basic_string symbols. Clearly, + // this is a compiler bug. And clearly, we don't want the check as we can't + // catch the exception anyway. + if (pd) pd->value = convertElementToValue(s->engine(), s->d()->container->at(index)); return PropertyKey::fromArrayIndex(index); -- cgit v1.2.3