diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-12-06 18:43:34 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-12-11 12:36:38 +0100 |
commit | d9fe0f3667e940f5313dbdb94f8247125106ee0d (patch) | |
tree | a5778c6a4da3a227fb70dca5738e4b74c207e3c7 /src | |
parent | f1bb9053896549ee74bb7301e7ae5ab28786d155 (diff) |
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 <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jsruntime/qv4sequenceobject.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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<char> + // 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); |