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

Unified Diff: sandbox/linux/seccomp-bpf/codegen.h

Issue 565713004: Linux sandbox: Remove CodeGen::JoinInstructions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/codegen.h
diff --git a/sandbox/linux/seccomp-bpf/codegen.h b/sandbox/linux/seccomp-bpf/codegen.h
index d5c513b1ac8833a477018c589ff6979fb3e8e3be..078cf3cedb7e218bc469962aa3c2b9f4d1dc79fc 100644
--- a/sandbox/linux/seccomp-bpf/codegen.h
+++ b/sandbox/linux/seccomp-bpf/codegen.h
@@ -30,20 +30,18 @@ typedef std::map<const BasicBlock*, int> IncomingBranches;
// build a DAG of Instructions. They'll eventually call Compile() to convert
// this DAG to a SandboxBPF::Program.
//
-// Instructions can be chained at the time when they are created, or they
-// can be joined later by calling JoinInstructions().
-//
// CodeGen gen;
-// Instruction *dag, *branch;
-// dag =
-// gen.MakeInstruction(BPF_LD+BPF_W+BPF_ABS,
-// offsetof(struct arch_seccomp_data, nr),
-// branch =
-// gen.MakeInstruction(BPF_JMP+BPF_EQ+BPF_K, __NR_getpid,
-// Trap(GetPidHandler, NULL), NULL);
-// gen.JoinInstructions(branch,
+// Instruction *allow, *branch, *dag;
+//
+// allow =
// gen.MakeInstruction(BPF_RET+BPF_K,
// ErrorCode(ErrorCode::ERR_ALLOWED).err()));
+// branch =
+// gen.MakeInstruction(BPF_JMP+BPF_EQ+BPF_K, __NR_getpid,
+// Trap(GetPidHandler, NULL), allow);
+// dag =
+// gen.MakeInstruction(BPF_LD+BPF_W+BPF_ABS,
+// offsetof(struct arch_seccomp_data, nr), branch);
//
// // Simplified code follows; in practice, it is important to avoid calling
// // any C++ destructors after starting the sandbox.
@@ -74,11 +72,6 @@ class SANDBOX_EXPORT CodeGen {
Instruction* jt,
Instruction* jf);
- // Join two (sequences of) instructions. This is useful, if the "next"
- // parameter had not originally been given in the call to MakeInstruction(),
- // or if a (conditional) jump still has an unsatisfied target.
- void JoinInstructions(Instruction* head, Instruction* tail);
-
// Traverse the graph of instructions and visit each instruction once.
// Traversal order is implementation-defined. It is acceptable to make
// changes to the graph from within the callback function. These changes
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698