Bug 1356392 - Use a release assert in EnumSerializer::Write. r=kanru draft
authorAndrew McCreight <continuation@gmail.com>
Thu, 13 Apr 2017 13:55:10 -0700
changeset 562391 abd9024ae5b255a3f30a1860066a432be5422058
parent 562390 c7f0d742fab1f3e9f4f7cd5d18d6e0b67509b93b
child 624232 f1d045bc8add692439f1da58bb1b714b0bf19a21
push id54018
push userbmo:continuation@gmail.com
push dateThu, 13 Apr 2017 21:00:35 +0000
reviewerskanru
bugs1356392
milestone55.0a1
Bug 1356392 - Use a release assert in EnumSerializer::Write. r=kanru MozReview-Commit-ID: JqnwuT3nn9q
ipc/glue/IPCMessageUtils.h
--- a/ipc/glue/IPCMessageUtils.h
+++ b/ipc/glue/IPCMessageUtils.h
@@ -115,17 +115,17 @@ static const uint32_t MAX_MESSAGE_SIZE =
  */
 template <typename E, typename EnumValidator>
 struct EnumSerializer {
   typedef E paramType;
   typedef typename mozilla::UnsignedStdintTypeForSize<sizeof(paramType)>::Type
           uintParamType;
 
   static void Write(Message* aMsg, const paramType& aValue) {
-    MOZ_ASSERT(EnumValidator::IsLegalValue(aValue));
+    MOZ_RELEASE_ASSERT(EnumValidator::IsLegalValue(aValue));
     WriteParam(aMsg, uintParamType(aValue));
   }
 
   static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
     uintParamType value;
     if (!ReadParam(aMsg, aIter, &value)) {
 #ifdef MOZ_CRASHREPORTER
       CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("IPCReadErrorReason"),