diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-01-06 10:01:07 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-02-08 08:30:53 +0000 |
commit | 06e1f124375569454d70675938f232f6bee396ac (patch) | |
tree | 14467d45434a9afe5550d64c184d8999c932897c | |
parent | cdc5f303016eb44406bca5463e9183ca9f0da54c (diff) |
Unbreak ubsan developer-build
Clang 3.8'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.
QDBusConnectionPrivate is a polymorphic non-exported class,
so this failed at link-time. Ditto for the other case.
Fix by autotest-exporting the classes.
Also, where applicable, de-inline the dtors, so the
vtable (and typeinfo) are pinned to one TU, and the
ctor, just because it's the correct thing to do.
Change-Id: I991f81f88d2a48e85d94d9f3ac61473c0b7056d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dbc3d8e15e7a158b540370d9f864fafdb55eddb4)
-rw-r--r-- | src/dbus/qdbusconnection_p.h | 2 | ||||
-rw-r--r-- | src/sql/models/qsqltablemodel.cpp | 5 | ||||
-rw-r--r-- | src/sql/models/qsqltablemodel_p.h | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h index d16cd05058..0d17f6a832 100644 --- a/src/dbus/qdbusconnection_p.h +++ b/src/dbus/qdbusconnection_p.h @@ -100,7 +100,7 @@ public: // QDBusConnectionPrivate holds the DBusConnection and // can have many QDBusConnection objects referring to it -class QDBusConnectionPrivate: public QObject +class Q_AUTOTEST_EXPORT QDBusConnectionPrivate: public QObject { Q_OBJECT public: diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index 6aa2eeb072..1149daea62 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -49,6 +49,11 @@ QT_BEGIN_NAMESPACE typedef QSqlTableModelSql Sql; +QSqlTableModelPrivate::~QSqlTableModelPrivate() +{ + +} + /*! \internal Populates our record with values. */ diff --git a/src/sql/models/qsqltablemodel_p.h b/src/sql/models/qsqltablemodel_p.h index 256410c3dd..f1e9cb7afa 100644 --- a/src/sql/models/qsqltablemodel_p.h +++ b/src/sql/models/qsqltablemodel_p.h @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE -class QSqlTableModelPrivate: public QSqlQueryModelPrivate +class Q_AUTOTEST_EXPORT QSqlTableModelPrivate: public QSqlQueryModelPrivate { Q_DECLARE_PUBLIC(QSqlTableModel) @@ -62,6 +62,8 @@ public: strategy(QSqlTableModel::OnRowChange), busyInsertingRows(false) {} + ~QSqlTableModelPrivate(); + void clear(); virtual void clearCache(); QSqlRecord record(const QVector<QVariant> &values) const; |