summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@nokia.com>2012-06-16 21:02:26 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-07-03 06:05:21 (GMT)
commit0e595ad22db04141bfbd6093824cdcc775fd371d (patch)
tree312a757ebe50ed08e45b0186fc6ef7c6256b3132 /src/corelib
parent2da55509d4344ed56ad8243b496398779fc3c98a (diff)
downloadQt-0e595ad22db04141bfbd6093824cdcc775fd371d.zip
Qt-0e595ad22db04141bfbd6093824cdcc775fd371d.tar.gz
Qt-0e595ad22db04141bfbd6093824cdcc775fd371d.tar.bz2
Fix access to uninitialized pointer
The C++ standard says in 9.4..2 that the object expression is evaluated, so any compliant compiler may access d. So this syntax is a bug in this place. This is a backport of commit 88cf9402e336fddeb673c92f3c14da47a9f8450b from qtbase. Change-Id: I02a9a1b73f7c18e8342aafeae412759f78086fa6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 7db8805..2902228 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -592,7 +592,7 @@ public:
#ifndef QT_NO_QOBJECT
// special constructor that is enabled only if X derives from QObject
template <class X>
- inline QWeakPointer(X *ptr) : d(ptr ? d->getAndRef(ptr) : 0), value(ptr)
+ inline QWeakPointer(X *ptr) : d(ptr ? Data::getAndRef(ptr) : 0), value(ptr)
{ }
#endif
template <class X>