From d91d3536eb82075aec25f3772c4209e15b7b3060 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 7 Jul 2016 10:57:03 +0200 Subject: Unbreak ubsan developer-build GCC's undefined-behavior sanitizer checks that the declared type of the object is a base class of the dynamic type of the object on each access to a member of a class type. It therefore requires the typeinfo for these types, which for polymorphic types is emitted in the TU where the vtable is emitted, too. QtPatternist::AtomicValue is a polymorphic non- exported class, so this failed at link-time. Ditto for the other cases. Fix by autotest-exporting the classes. Also, where applicable, de-inline the dtors, so the vtable (and typeinfo) are pinned to one TU. Change-Id: I5c47be779a3833433a7108a79a57d61a93ab5494 Reviewed-by: Thiago Macieira --- src/xmlpatterns/data/qitem_p.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/xmlpatterns/data/qitem_p.h') diff --git a/src/xmlpatterns/data/qitem_p.h b/src/xmlpatterns/data/qitem_p.h index c89add1..c5a168d 100644 --- a/src/xmlpatterns/data/qitem_p.h +++ b/src/xmlpatterns/data/qitem_p.h @@ -105,8 +105,7 @@ namespace QPatternist * @ingroup Patternist_xdm * @author Frans Englich */ - class AtomicValue : public QSharedData - , public CppCastingHelper + class Q_AUTOTEST_EXPORT AtomicValue : public QSharedData, public CppCastingHelper { public: virtual ~AtomicValue(); -- cgit v1.2.1 From b4b17b2035ce38b1bf4d90458d4c64dc9551c733 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 18 Jul 2016 11:51:57 +0300 Subject: Item: replace a Q_ASSERT with a Q_STATIC_ASSERT Change-Id: I32927731c73b5335f2589c0754ffef2cf0d5ed3f Reviewed-by: Tobias Koenig Reviewed-by: Frederik Gladhorn --- src/xmlpatterns/data/qitem_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xmlpatterns/data/qitem_p.h') diff --git a/src/xmlpatterns/data/qitem_p.h b/src/xmlpatterns/data/qitem_p.h index c5a168d..d470f45 100644 --- a/src/xmlpatterns/data/qitem_p.h +++ b/src/xmlpatterns/data/qitem_p.h @@ -205,7 +205,7 @@ namespace QPatternist inline Item(const Item &other) : node(other.node) { - Q_ASSERT_X(sizeof(QXmlNodeModelIndex) >= sizeof(AtomicValue), Q_FUNC_INFO, + Q_STATIC_ASSERT_X(sizeof(QXmlNodeModelIndex) >= sizeof(AtomicValue), "Since we're only copying the node member, it must be the largest."); if(isAtomicValue()) atomicValue->ref.ref(); -- cgit v1.2.1