diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2021-06-18 16:58:21 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2021-06-22 08:34:28 -0700 |
| commit | 00f2317254576e4873e9c3f3131b885ce3f9d88d (patch) | |
| tree | efe509fac6eb70b7fb9fd163765a339c6a241467 /src/qml/compiler/qv4codegen.cpp | |
| parent | 58cd06033cacadab541efaa16a3eecec37dab0fa (diff) | |
Suppress GCC11 warning about maybe-uninitialized data access
I don't *think* the compiler is correct. It's complaining that the
copy-construction of PathComponent in the lambda here:
bool dvReference(DirectVisitor visitor, const PathEls::PathComponent &c, Path referencedObject)
{
return dvItem(visitor, c, [c, this, referencedObject]() {
return this->subReferenceItem(c, referencedObject);
});
}
which was created as a temporary in dvReferenceField:
return dvReference(visitor, PathEls::Field(f), referencedObject);
could be copying garbage. Note that the warning is about copying a
PathComponent::Data of kind Key, whereas this inline sequence is of
Field.
Of course, the whole PathComponent::Data is a major ill-advised disaster
waiting to happen...
In copy constructor ‘QArrayDataPointer<T>::QArrayDataPointer(const QArrayDataPointer<T>&) [with T = char16_t]’,
inlined from ‘QString::QString(const QString&)’ at qstring.h:1232:58,
inlined from ‘QQmlJS::Dom::PathEls::Key::Key(const QQmlJS::Dom::PathEls::Key&)’ at src/qmldom/qqmldompath_p.h:164:7,
inlined from ‘QQmlJS::Dom::PathEls::PathComponent::Data::Data(const QQmlJS::Dom::PathEls::PathComponent::Data&)’ at src/qmldom/qqmldompath_p.h:369:37,
inlined from ‘QQmlJS::Dom::PathEls::PathComponent::PathComponent(const QQmlJS::Dom::PathEls::PathComponent&)’ at src/qmldom/qqmldompath_p.h:311:7,
inlined from ‘bool QQmlJS::Dom::DomItem::dvReference(QQmlJS::Dom::DirectVisitor, const QQmlJS::Dom::PathEls::PathComponent&, QQmlJS::Dom::Path)’ at src/qmldom/qqmldomitem_p.h:981:22,
inlined from ‘bool QQmlJS::Dom::DomItem::dvReferenceField(QQmlJS::Dom::DirectVisitor, QStringView, QQmlJS::Dom::Path)’ at src/qmldom/qqmldomitem_p.h:991:27:
qarraydatapointer.h:69:50: error: ‘*(const QArrayDataPointer<char16_t>*)((char*)&<unnamed> + offsetof(const QQmlJS::Dom::PathEls::PathComponent, QQmlJS::Dom::PathEls::PathComponent::data) + 8).QArrayDataPointer<char16_t>::size’ may be used uninitialized [-Werror=maybe-uninitialized]
69 | : d(other.d), ptr(other.ptr), size(other.size)
| ~~~~~~^~~~
In file included from src/qmldom/qqmldomelements_p.h:52,
from src/qmldom/qqmldomelements.cpp:38:
src/qmldom/qqmldomitem_p.h: In member function ‘bool QQmlJS::Dom::DomItem::dvReferenceField(QQmlJS::Dom::DirectVisitor, QStringView, QQmlJS::Dom::Path)’:
src/qmldom/qqmldomitem_p.h:991:27: note: ‘<anonymous>’ declared here
991 | return dvReference(visitor, PathEls::Field(f), referencedObject);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: Iddb933f281024939b6acfffd1689d2fdea0adc61
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
0 files changed, 0 insertions, 0 deletions
