From 72ba369a115d97f707cbe6131d8daa751dc5b355 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 17 Jul 2016 13:50:04 +0200 Subject: Fix type of QCommonValues::YearMonthDurationZero As reported by UBSan: src/corelib/tools/qshareddata.h:167:13: runtime error: downcast of address 0x0000023ce510 which does not point to an object of type 'DayTimeDuration' 0x0000023ce510: note: object is of type 'QPatternist::YearMonthDuration' 00 00 00 00 90 6c 52 5b 1f 2b 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 31 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QPatternist::YearMonthDuration' Another victim of QT_ENABLE_QEXPLICITLYSHAREDDATAPOINTER_STATICCAST... Change-Id: I121433e0d2ad8b203ccf9d9f08bd166b39502cbb Reviewed-by: Tobias Koenig Reviewed-by: Frederik Gladhorn --- src/xmlpatterns/data/qcommonvalues.cpp | 2 +- src/xmlpatterns/data/qcommonvalues_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xmlpatterns/data/qcommonvalues.cpp b/src/xmlpatterns/data/qcommonvalues.cpp index 6fa3738..c9eee2d 100644 --- a/src/xmlpatterns/data/qcommonvalues.cpp +++ b/src/xmlpatterns/data/qcommonvalues.cpp @@ -108,7 +108,7 @@ const AtomicValue::Ptr CommonValues::InfFloat const DayTimeDuration::Ptr CommonValues::DayTimeDurationZero (DayTimeDuration::fromSeconds(0)); -const DayTimeDuration::Ptr CommonValues::YearMonthDurationZero +const YearMonthDuration::Ptr CommonValues::YearMonthDurationZero (YearMonthDuration::fromComponents(true, 0, 0)); diff --git a/src/xmlpatterns/data/qcommonvalues_p.h b/src/xmlpatterns/data/qcommonvalues_p.h index 9b84de9..00e9507 100644 --- a/src/xmlpatterns/data/qcommonvalues_p.h +++ b/src/xmlpatterns/data/qcommonvalues_p.h @@ -198,7 +198,7 @@ namespace QPatternist /** * The @c xs:yearMonthDuration value P0M */ - static const DayTimeDuration::Ptr YearMonthDurationZero; + static const YearMonthDuration::Ptr YearMonthDurationZero; private: /** -- cgit v1.2.1