From 907923b7cafad8cff6f0f5c8764e9181ac1531bd Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 17 Jul 2019 18:03:19 +0200 Subject: qmake: fix move semantics ProFunctionDef is move-enabled, meaning its `m_pro` field can become nullptr. Its usage in the assignment operator and the dtor must therefore be protected with a check. Amends 9c63ad562bf0a44807f41ce49e4fe1b5ff181a63. Change-Id: I0c77b07dc83969565480bbb9d9fc80751d4246b1 Reviewed-by: Marc Mutz --- qmake/library/proitems.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h index 0e0bebddc7..936c729ff8 100644 --- a/qmake/library/proitems.h +++ b/qmake/library/proitems.h @@ -432,11 +432,12 @@ public: ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); } ProFunctionDef(ProFunctionDef &&other) Q_DECL_NOTHROW : m_pro(other.m_pro), m_offset(other.m_offset) { other.m_pro = nullptr; } - ~ProFunctionDef() { m_pro->deref(); } + ~ProFunctionDef() { if (m_pro) m_pro->deref(); } ProFunctionDef &operator=(const ProFunctionDef &o) { if (this != &o) { - m_pro->deref(); + if (m_pro) + m_pro->deref(); m_pro = o.m_pro; m_pro->ref(); m_offset = o.m_offset; -- cgit v1.2.3 From a96a64be2dc3110d140e43d2cf85454d9fc998b8 Mon Sep 17 00:00:00 2001 From: Yulong Bai Date: Thu, 18 Jul 2019 17:21:23 +0200 Subject: qmake: fix variable naming conflicts with C++20 keyword It conflicts with 'requires' keyword. Fixes: QTBUG-77093 Change-Id: I85e8f530dd1e2bf9a31906dd6c5123b947235b01 Reviewed-by: Marc Mutz --- qmake/generators/makefile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index bc59eaaea2..11623cd147 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -3418,9 +3418,9 @@ MakefileGenerator::writePkgConfigFile() t << endl; // requires - const QString requires = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' '); - if (!requires.isEmpty()) { - t << "Requires: " << requires << endl; + const QString requiresString = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' '); + if (!requiresString.isEmpty()) { + t << "Requires: " << requiresString << endl; } t << endl; -- cgit v1.2.3