From 0e595ad22db04141bfbd6093824cdcc775fd371d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Sat, 16 Jun 2012 23:02:26 +0200 Subject: 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 --- src/corelib/tools/qsharedpointer_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 - 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 -- cgit v0.12