Merge lp:~aacid/ubuntu-ui-toolkit/initialize_variable into lp:ubuntu-ui-toolkit/staging

Proposed by Albert Astals Cid
Status: Merged
Approved by: Zsombor Egri
Approved revision: 2167
Merged at revision: 2167
Proposed branch: lp:~aacid/ubuntu-ui-toolkit/initialize_variable
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 11 lines (+1/-0)
1 file modified
src/UbuntuToolkit/ucslotslayout.cpp (+1/-0)
To merge this branch: bzr merge lp:~aacid/ubuntu-ui-toolkit/initialize_variable
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Andrea Bernabei (community) Approve
Review via email: mp+316135@code.launchpad.net

Commit message

Fix conditional jump or move depends on uninitialised value(s)

    Valgrind says
    ==11560== Conditional jump or move depends on uninitialised value(s)
    ==11560== at 0x2D64BC9F: getVerticalPositioningMode (ucslotslayout.cpp:75)
    ==11560== by 0x2D64BC9F: UCSlotsLayoutPrivate::updateTopBottomPaddingIfNeeded() (ucslotslayout.cpp:82)
    ==11560== by 0x2D64CEA9: UCSlotsLayoutPrivate::_q_updateGuValues() (ucslotslayout.cpp:211)
    ==11560== by 0x2D64CEFA: UCSlotsLayoutPrivate::init() (ucslotslayout.cpp:50)
    ==11560== by 0x2D63DE88: UCListItemLayout::UCListItemLayout(QQuickItem*) (uclistitemlayout.cpp:353)
    ==11560== by 0x2D60037F: QQmlElement (qqmlprivate.h:99)
    ==11560== by 0x2D60037F: void QQmlPrivate::createInto<UCListItemLayout>(void*) (qqmlprivate.h:108)
    ==11560== by 0x6BD1C98: QQmlType::create() const (qqmlmetatype.cpp:746)
    ==11560== by 0x6C33F3B: QQmlObjectCreator::createInstance(int, QObject*, bool) (qqmlobjectcreator.cpp:1080)
    ==11560== by 0x6C3645E: QQmlObjectCreator::setPropertyBinding(QQmlPropertyData const*, QV4::CompiledData::Binding const*) (qqmlobjectcreator.cpp:776)
    ==11560== by 0x6C366C7: QQmlObjectCreator::setupBindings(QBitArray const&) (qqmlobjectcreator.cpp:728)
    ==11560== by 0x6C33655: QQmlObjectCreator::populateInstance(int, QObject*, QObject*, QQmlPropertyData const*, QBitArray const&) (qqmlobjectcreator.cpp:1355)
    ==11560== by 0x6C34236: QQmlObjectCreator::createInstance(int, QObject*, bool) (qqmlobjectcreator.cpp:1202)
    ==11560== by 0x6C34A55: QQmlObjectCreator::create(int, QObject*, QQmlInstantiationInterrupt*) (qqmlobjectcreator.cpp:204)

To post a comment you must log in.
Revision history for this message
Andrea Bernabei (faenil) wrote :

Thanks, good catch!

Which makes me think, we should definitely be using -Wuninitialized and -Werror=unintialized

What do you think?

Revision history for this message
Andrea Bernabei (faenil) wrote :

great, thanks!

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Bernabei (faenil) wrote :

after checking -Wuninitialized doc, it seems it does not catch uninitialized members (in fact, it would be really trick to check that). So that wouldn't help

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/UbuntuToolkit/ucslotslayout.cpp'
2--- src/UbuntuToolkit/ucslotslayout.cpp 2016-10-07 14:33:47 +0000
3+++ src/UbuntuToolkit/ucslotslayout.cpp 2017-02-01 16:11:23 +0000
4@@ -32,6 +32,7 @@
5 : QQuickItemPrivate()
6 , mainSlot(Q_NULLPTR)
7 , m_parentItem(Q_NULLPTR)
8+ , mainSlotHeight(0)
9 , maxSlotsHeight(0)
10 , _q_cachedHeight(-1)
11 , maxNumberOfLeadingSlots(1)

Subscribers

People subscribed via source and target branches