From 88cf9402e336fddeb673c92f3c14da47a9f8450b Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Sat, 16 Jun 2012 22:52:03 +0200 Subject: Fix access to uninitialized pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Change-Id: I37d2c4ea54febd40410ca473c906bcb1c66c4974 Reviewed-by: Thiago Macieira Reviewed-by: Jędrzej Nowacki --- src/corelib/tools/qsharedpointer_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qsharedpointer_impl.h') diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 4a1a499be0..46cd1cc0a7 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -512,7 +512,7 @@ public: // special constructor that is enabled only if X derives from QObject #if QT_DEPRECATED_SINCE(5, 0) template - QT_DEPRECATED inline QWeakPointer(X *ptr) : d(ptr ? d->getAndRef(ptr) : 0), value(ptr) + QT_DEPRECATED inline QWeakPointer(X *ptr) : d(ptr ? Data::getAndRef(ptr) : 0), value(ptr) { } #endif #endif -- cgit v1.2.3