| Index: sandbox/linux/seccomp-bpf/codegen.cc
|
| diff --git a/sandbox/linux/seccomp-bpf/codegen.cc b/sandbox/linux/seccomp-bpf/codegen.cc
|
| index 2273cafe7b3ec9e16b5198d3fdd2469c70a5418d..9c347930f3f07481e509e2369fa68ddf7e15958c 100644
|
| --- a/sandbox/linux/seccomp-bpf/codegen.cc
|
| +++ b/sandbox/linux/seccomp-bpf/codegen.cc
|
| @@ -14,31 +14,6 @@
|
| #include "sandbox/linux/seccomp-bpf/instruction.h"
|
| #include "sandbox/linux/seccomp-bpf/linux_seccomp.h"
|
|
|
| -namespace {
|
| -
|
| -// Helper function for Traverse().
|
| -void TraverseRecursively(std::set<sandbox::Instruction*>* visited,
|
| - sandbox::Instruction* instruction) {
|
| - if (visited->find(instruction) == visited->end()) {
|
| - visited->insert(instruction);
|
| - switch (BPF_CLASS(instruction->code)) {
|
| - case BPF_JMP:
|
| - if (BPF_OP(instruction->code) != BPF_JA) {
|
| - TraverseRecursively(visited, instruction->jf_ptr);
|
| - }
|
| - TraverseRecursively(visited, instruction->jt_ptr);
|
| - break;
|
| - case BPF_RET:
|
| - break;
|
| - default:
|
| - TraverseRecursively(visited, instruction->next);
|
| - break;
|
| - }
|
| - }
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| namespace sandbox {
|
|
|
| CodeGen::CodeGen() : compiled_(false) {}
|
| @@ -189,18 +164,6 @@ Instruction* CodeGen::MakeInstruction(uint16_t code,
|
| return insn;
|
| }
|
|
|
| -void CodeGen::Traverse(Instruction* instruction,
|
| - void (*fnc)(Instruction*, void*),
|
| - void* aux) {
|
| - std::set<Instruction*> visited;
|
| - TraverseRecursively(&visited, instruction);
|
| - for (std::set<Instruction*>::const_iterator iter = visited.begin();
|
| - iter != visited.end();
|
| - ++iter) {
|
| - fnc(*iter, aux);
|
| - }
|
| -}
|
| -
|
| void CodeGen::FindBranchTargets(const Instruction& instructions,
|
| BranchTargets* branch_targets) {
|
| // Follow all possible paths through the "instructions" graph and compute
|
|
|