diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2025-01-17 18:04:22 -0800 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2025-01-27 12:41:06 -0800 |
| commit | 744fda9cb4d4b2ca2e21ab0d003d835c292efa74 (patch) | |
| tree | c488d9ece1d7278e1a841e4084762da0af1f8f35 /src/corelib/kernel/qobject.cpp | |
| parent | 1b85143d217042876209794bf8d0361b7ce8834f (diff) | |
QObjectPrivate: encode the version number in the constructor parameters
Instead of allowing the code to start and then possibly fail at runtime.
This isn't a 100% sure solution because it's a function call. With lazy
symbol binding on some OSes, the mistake won't be noticed until the
function call is attempted. However, most OSes now resolve *all* calls
at load time so they can mark the GOT (or equivalent) pages read-only,
meaning the loading of the library will fail.
qversiontagging_p.h is a more sure way in OSes / executable formats it
works on.
Change-Id: If7867a37256b7141001dfffd9bd299bb1bbd7c63
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
| -rw-r--r-- | src/corelib/kernel/qobject.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 2a419aabf8e..b631b534c2e 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -158,11 +158,9 @@ QMetaObject *QObjectData::dynamicMetaObject() const return metaObject->toDynamicMetaObject(q_ptr); } -QObjectPrivate::QObjectPrivate(int version) +QObjectPrivate::QObjectPrivate(decltype(QObjectPrivateVersion)) : threadData(nullptr), currentChildBeingDeleted(nullptr) { - checkForIncompatibleLibraryVersion(version); - // QObjectData initialization q_ptr = nullptr; parent = nullptr; // no parent yet. It is set by setParent() |
