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
--- 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