Skip to content

Commit

Permalink
bpf_dsl: fix argument-dependent lookup of BoolExpr operators
Browse files Browse the repository at this point in the history
Review URL: https://codereview.chromium.org/543333002

Cr-Commit-Position: refs/heads/master@{#294127}
  • Loading branch information
mdempsky authored and Commit bot committed Sep 10, 2014
1 parent 5f74261 commit b3038b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
5 changes: 0 additions & 5 deletions components/nacl/loader/nonsfi/nonsfi_sandbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ using sandbox::bpf_dsl::Error;
using sandbox::bpf_dsl::If;
using sandbox::bpf_dsl::ResultExpr;

// TODO(mdempsky): Make BoolExpr a standalone class so these operators can
// be resolved via argument-dependent lookup.
using sandbox::bpf_dsl::operator&&;
using sandbox::bpf_dsl::operator||;

namespace nacl {
namespace nonsfi {
namespace {
Expand Down
8 changes: 8 additions & 0 deletions sandbox/linux/bpf_dsl/bpf_dsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ class SANDBOX_EXPORT Caser {
// templates.
namespace internal {

// Make argument-dependent lookup work. This is necessary because although
// BoolExpr is defined in bpf_dsl, since it's merely a typedef for
// scoped_refptr<const internal::BoolExplImpl>, argument-dependent lookup only
// searches the "internal" nested namespace.
using bpf_dsl::operator!;
using bpf_dsl::operator||;
using bpf_dsl::operator&&;

// Returns a boolean expression that represents whether system call
// argument |num| of size |size| is equal to |val|, when masked
// according to |mask|. Users should use the Arg template class below
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ using sandbox::bpf_dsl::Error;
using sandbox::bpf_dsl::If;
using sandbox::bpf_dsl::ResultExpr;

// TODO(mdempsky): Make BoolExpr a standalone class so these operators can
// be resolved via argument-dependent lookup.
using sandbox::bpf_dsl::operator||;
using sandbox::bpf_dsl::operator&&;

namespace sandbox {

// Allow Glibc's and Android pthread creation flags, crash on any other
Expand Down

0 comments on commit b3038b5

Please sign in to comment.