diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-05-22 17:33:03 +0200 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2018-05-24 09:44:39 +0000 |
commit | 8ea31bb1e1f21ed470aee8c3b2df800e63ae5ec3 (patch) | |
tree | def1425b9da86c817aa8726ebd215ca166ec15d5 /src/libs/utils | |
parent | e92b46073e5f7f0e280801d1402326d65a904ff6 (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.h | 3 |
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; |