Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: sandbox/linux/seccomp-bpf/verifier.cc

Issue 659723002: SyscallIterator: support C++11 range-based for loops (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and fix style Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sandbox/linux/seccomp-bpf/verifier.cc
diff --git a/sandbox/linux/seccomp-bpf/verifier.cc b/sandbox/linux/seccomp-bpf/verifier.cc
index 707bc45efd68852db0f82dfb6ca280ee58f910d0..700729d0507bc6617e967238dedd230ddc3a36b2 100644
--- a/sandbox/linux/seccomp-bpf/verifier.cc
+++ b/sandbox/linux/seccomp-bpf/verifier.cc
@@ -318,8 +318,7 @@ bool Verifier::VerifyBPF(bpf_dsl::PolicyCompiler* compiler,
const bpf_dsl::SandboxBPFDSLPolicy& policy,
const char** err) {
*err = NULL;
- for (SyscallIterator iter(false); !iter.Done();) {
- uint32_t sysnum = iter.Next();
+ for (uint32_t sysnum : SyscallSet::ALL) {
// We ideally want to iterate over the full system call range and values
// just above and just below this range. This gives us the full result set
// of the "evaluators".
@@ -340,7 +339,7 @@ bool Verifier::VerifyBPF(bpf_dsl::PolicyCompiler* compiler,
}
#endif
#endif
- ErrorCode code = iter.IsValid(sysnum)
+ ErrorCode code = SyscallIterator::IsValid(sysnum)
? policy.EvaluateSyscall(sysnum)->Compile(compiler)
: policy.InvalidSyscall()->Compile(compiler);
if (!VerifyErrorCode(compiler, program, &data, code, code, err)) {

Powered by Google App Engine
This is Rietveld 408576698