[libc++] Fix a use-after-move introduced in D118003.
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Wed, 9 Mar 2022 02:56:25 +0000 (21:56 -0500)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Wed, 9 Mar 2022 02:57:40 +0000 (21:57 -0500)
Thanks to Eric Fiselier for catching this!

libcxx/include/__algorithm/sift_down.h

index 6a6646d..0351a1c 100644 (file)
@@ -98,7 +98,7 @@ __floyd_sift_down(_RandomAccessIterator __first, _Compare __comp,
 
         // swap __hole with its largest child
         *__hole = std::move(*__child_i);
-        __hole = std::move(__child_i);
+        __hole = __child_i;
 
         // if __hole is now a leaf, we're done
         if (__child > (__len - 2) / 2)