Bug 1383007 - Move the declaration in the #ifdef declaration to silent a warning r=jld
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 21 Jul 2017 23:28:47 +0200
changeset 370306 394b3d22db1988839462c9832f4ef309aef556a1
parent 370305 4ed067a3c2941aada4f32eb63b68d5574a2a2c80
child 370307 a6b857d87680ed39db4a64a2309e864a93194b7f
push id32214
push userarchaeopteryx@coole-files.de
push dateSat, 22 Jul 2017 09:27:12 +0000
treeherdermozilla-central@7e496e6bac00 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld
bugs1383007
milestone56.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 1383007 - Move the declaration in the #ifdef declaration to silent a warning r=jld Otherwise, a warning is triggered because the statement will never be executed [- Found with -Wswitch-unreachable with gcc 7 MozReview-Commit-ID: FVStzyFlhJp
security/sandbox/linux/SandboxFilter.cpp
--- a/security/sandbox/linux/SandboxFilter.cpp
+++ b/security/sandbox/linux/SandboxFilter.cpp
@@ -569,18 +569,18 @@ public:
   Maybe<ResultExpr> EvaluateIpcCall(int aCall) const override {
     switch(aCall) {
       // SysV IPC is a problem: it follows the Unix "same uid policy"
       // and can't be restricted/brokered like file access.
 #ifdef MOZ_ALSA
     case SEMGET:
     case SEMCTL:
     case SEMOP:
+      return Some(Allow());
 #endif
-      return Some(Allow());
     default:
       return SandboxPolicyCommon::EvaluateIpcCall(aCall);
     }
   }
 #endif
 
   ResultExpr EvaluateSyscall(int sysno) const override {
     // Straight allow for anything that got overriden via prefs