Bug 1383007 - Move the declaration in the #ifdef declaration to silent a warning r?jld draft
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 21 Jul 2017 23:28:47 +0200
changeset 613400 b2756c7e79d52ff17ec19cb2a6db4d0fc54cd716
parent 612927 5c2fd97f164519dfe11107f585418ab8a70877da
child 638665 6d05ac2d7031636ef480bbf7717997b8e2fd128f
push id69786
push userbmo:sledru@mozilla.com
push dateFri, 21 Jul 2017 21:30:21 +0000
reviewersjld
bugs1383007
milestone56.0a1
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