Bug 1365802 - In VariantImplementation::moveConstruct, move the aRhs rvalue to the next moveConstruct - r=froydnj
authorGerald Squelart <gsquelart@mozilla.com>
Thu, 18 May 2017 15:39:40 +1200
changeset 410592 97ce14cb28f98838664b6f8576b577ba65df14ee
parent 410591 f60d569fdbc0d6def90ef0c6864e97cc07a0ee96
child 410593 dc53ed710486d80d6d3029d0b51440982bab2e43
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1365802
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1365802 - In VariantImplementation::moveConstruct, move the aRhs rvalue to the next moveConstruct - r=froydnj Without the Move(), a temporary copy is created and passed as rvalue. MozReview-Commit-ID: B3MXz6yzO39
mfbt/Variant.h
--- a/mfbt/Variant.h
+++ b/mfbt/Variant.h
@@ -229,17 +229,17 @@ struct VariantImplementation<Tag, N, T, 
     }
   }
 
   template<typename Variant>
   static void moveConstruct(void* aLhs, Variant&& aRhs) {
     if (aRhs.template is<T>()) {
       ::new (KnownNotNull, aLhs) T(aRhs.template extract<T>());
     } else {
-      Next::moveConstruct(aLhs, aRhs);
+      Next::moveConstruct(aLhs, Move(aRhs));
     }
   }
 
   template<typename Variant>
   static void destroy(Variant& aV) {
     if (aV.template is<T>()) {
       aV.template as<T>().~T();
     } else {