summaryrefslogtreecommitdiff
path: root/src/mongo/s/query
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-08-31 18:40:55 -0400
committerMathias Stearn <mathias@10gen.com>2015-09-18 14:00:07 -0400
commitd38d401f6a11f20023aa2628723976fa993c16b6 (patch)
treeeb1ca736d2fa15c85e7cf2c7b41941fb2da085a4 /src/mongo/s/query
parentdd8014ab860189880ba258637e48d2b637de0a5c (diff)
downloadmongo-d38d401f6a11f20023aa2628723976fa993c16b6.tar.gz
SERVER-20233 Custom move assignments must handle self-assignment
On MSVC2013 they must be no-ops. On other platforms they can leave the object in a valid but unspecified state.
Diffstat (limited to 'src/mongo/s/query')
-rw-r--r--src/mongo/s/query/cluster_cursor_manager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/s/query/cluster_cursor_manager.cpp b/src/mongo/s/query/cluster_cursor_manager.cpp
index 4d26e54974d..0c0b9a45077 100644
--- a/src/mongo/s/query/cluster_cursor_manager.cpp
+++ b/src/mongo/s/query/cluster_cursor_manager.cpp
@@ -95,6 +95,11 @@ ClusterCursorManager::PinnedCursor::PinnedCursor(PinnedCursor&& other)
ClusterCursorManager::PinnedCursor& ClusterCursorManager::PinnedCursor::operator=(
ClusterCursorManager::PinnedCursor&& other) {
+#if defined(_MSC_VER) && _MSC_VER < 1900 // MSVC 2013 STL can emit self-move-assign.
+ if (&other == this)
+ return *this;
+#endif
+
if (_cursor) {
// The underlying cursor has not yet been returned.
returnAndKillCursor();