Bug 1643347 - set hasFlag default value to avoid a -Wuninitialized-const-reference warning in ContentPrincipal.cpp r=dmajor
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 04 Jun 2020 14:46:32 +0000
changeset 533904 a680dbc851bfcf5537bd1c3f97fe274d13c99d18
parent 533903 90fb6ec67a4f32654e82d8f33e1bfe1ca7692199
child 533905 388ee310704b765ea81a300960289bb3031a2904
push id37480
push userncsoregi@mozilla.com
push dateThu, 04 Jun 2020 22:00:12 +0000
treeherdermozilla-central@e33aea19d0c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1643347
milestone79.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 1643347 - set hasFlag default value to avoid a -Wuninitialized-const-reference warning in ContentPrincipal.cpp r=dmajor Differential Revision: https://phabricator.services.mozilla.com/D78289
caps/ContentPrincipal.cpp
--- a/caps/ContentPrincipal.cpp
+++ b/caps/ContentPrincipal.cpp
@@ -59,17 +59,17 @@ nsresult ContentPrincipal::Init(nsIURI* 
                                 const nsACString& aOriginNoSuffix) {
   NS_ENSURE_ARG(aURI);
 
   // Assert that the URI we get here isn't any of the schemes that we know we
   // should not get here.  These schemes always either inherit their principal
   // or fall back to a null principal.  These are schemes which return
   // URI_INHERITS_SECURITY_CONTEXT from their protocol handler's
   // GetProtocolFlags function.
-  bool hasFlag;
+  bool hasFlag = false;
   Unused << hasFlag;  // silence possible compiler warnings.
   MOZ_DIAGNOSTIC_ASSERT(
       NS_SUCCEEDED(NS_URIChainHasFlags(
           aURI, nsIProtocolHandler::URI_INHERITS_SECURITY_CONTEXT, &hasFlag)) &&
       !hasFlag);
 
   mURI = aURI;
   FinishInit(aOriginNoSuffix, aOriginAttributes);