aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-05-22 17:33:03 +0200
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-05-24 09:44:39 +0000
commit8ea31bb1e1f21ed470aee8c3b2df800e63ae5ec3 (patch)
treedef1425b9da86c817aa8726ebd215ca166ec15d5 /src/libs/utils
parente92b46073e5f7f0e280801d1402326d65a904ff6 (diff)
Utils: Fix unit-test failure caused by SmallString issue
Failing test: SymbolsCollector.CollectUsedMacrosWithoutExternalDefine std::stable_partition can move-assigne object to itself which was not properly handled in SmallString. Change-Id: I719f3cb78cdace5fdbd9fcac3f5f099baa58a8c2 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/libs/utils')
-rw-r--r--src/libs/utils/smallstring.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libs/utils/smallstring.h b/src/libs/utils/smallstring.h
index 321f88bbe65..59fc3d6699a 100644
--- a/src/libs/utils/smallstring.h
+++ b/src/libs/utils/smallstring.h
@@ -183,6 +183,9 @@ public:
BasicSmallString &operator=(BasicSmallString &&other) noexcept
{
+ if (this == &other)
+ return *this;
+
this->~BasicSmallString();
m_data = other.m_data;