Bug 1329334 - Variant::as<> should use MOZ_RELEASE_ASSERT. r=froydnj
authorJames Cheng <jacheng@mozilla.com>
Tue, 10 Jan 2017 14:24:49 +0800
changeset 373807 30d0b78371d543b6691a4edbb1f57628917fd562
parent 373806 044fecccb3d908be3af47449469440c0029cb1fc
child 373808 b419aaefae9553e2dfd6d634c62a5c5721bc0923
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1329334
milestone53.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 1329334 - Variant::as<> should use MOZ_RELEASE_ASSERT. r=froydnj MozReview-Commit-ID: E95959RYm2r
mfbt/Variant.h
--- a/mfbt/Variant.h
+++ b/mfbt/Variant.h
@@ -570,26 +570,26 @@ public:
 
   // Accessors for working with the contained variant value.
 
   /** Mutable reference. */
   template<typename T>
   T& as() {
     static_assert(detail::IsVariant<T, Ts...>::value,
                   "provided a type not found in this Variant's type list");
-    MOZ_ASSERT(is<T>());
+    MOZ_RELEASE_ASSERT(is<T>());
     return *reinterpret_cast<T*>(&raw);
   }
 
   /** Immutable const reference. */
   template<typename T>
   const T& as() const {
     static_assert(detail::IsVariant<T, Ts...>::value,
                   "provided a type not found in this Variant's type list");
-    MOZ_ASSERT(is<T>());
+    MOZ_RELEASE_ASSERT(is<T>());
     return *reinterpret_cast<const T*>(&raw);
   }
 
   /**
    * Extract the contained variant value from this container into a temporary
    * value.  On completion, the value in the variant will be in a
    * safely-destructible state, as determined by the behavior of T's move
    * constructor when provided the variant's internal value.