diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-02-21 21:35:54 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-02-22 07:00:43 +0000 |
commit | 809cef1732df9f843dc895cfb3f4b3e58646e050 (patch) | |
tree | bd86ca93a28977261c5bae65a4e6774ad06d30d1 /src/corelib/tools/qtimezone.cpp | |
parent | 370bfc0b0ddfec25982ba815153d58ab0266a9f8 (diff) | |
download | qtbase-809cef1732df9f843dc895cfb3f4b3e58646e050.tar.gz |
QTimeZone: do not access static functions through this->
The this pointer cannot be null, so we can't do d->staticFunction while
d is a null pointer. This was caught by Clang 3.8's ubsan.
Change-Id: I3c0d39b88cca83d827a69ed1544a4412b18ac907
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qtimezone.cpp')
-rw-r--r-- | src/corelib/tools/qtimezone.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp index 359c2d0bdb..ec2f7c4af6 100644 --- a/src/corelib/tools/qtimezone.cpp +++ b/src/corelib/tools/qtimezone.cpp @@ -674,9 +674,9 @@ bool QTimeZone::isDaylightTime(const QDateTime &atDateTime) const QTimeZone::OffsetData QTimeZone::offsetData(const QDateTime &forDateTime) const { if (hasTransitions()) - return d->toOffsetData(d->data(forDateTime.toMSecsSinceEpoch())); + return QTimeZonePrivate::toOffsetData(d->data(forDateTime.toMSecsSinceEpoch())); else - return d->invalidOffsetData(); + return QTimeZonePrivate::invalidOffsetData(); } /*! @@ -712,9 +712,9 @@ bool QTimeZone::hasTransitions() const QTimeZone::OffsetData QTimeZone::nextTransition(const QDateTime &afterDateTime) const { if (hasTransitions()) - return d->toOffsetData(d->nextTransition(afterDateTime.toMSecsSinceEpoch())); + return QTimeZonePrivate::toOffsetData(d->nextTransition(afterDateTime.toMSecsSinceEpoch())); else - return d->invalidOffsetData(); + return QTimeZonePrivate::invalidOffsetData(); } /*! @@ -733,9 +733,9 @@ QTimeZone::OffsetData QTimeZone::nextTransition(const QDateTime &afterDateTime) QTimeZone::OffsetData QTimeZone::previousTransition(const QDateTime &beforeDateTime) const { if (hasTransitions()) - return d->toOffsetData(d->previousTransition(beforeDateTime.toMSecsSinceEpoch())); + return QTimeZonePrivate::toOffsetData(d->previousTransition(beforeDateTime.toMSecsSinceEpoch())); else - return d->invalidOffsetData(); + return QTimeZonePrivate::invalidOffsetData(); } /*! @@ -755,7 +755,7 @@ QTimeZone::OffsetDataList QTimeZone::transitions(const QDateTime &fromDateTime, toDateTime.toMSecsSinceEpoch()); list.reserve(plist.count()); for (const QTimeZonePrivate::Data &pdata : plist) - list.append(d->toOffsetData(pdata)); + list.append(QTimeZonePrivate::toOffsetData(pdata)); } return list; } |