Commit b3038b54 authored by mdempsky's avatar mdempsky Committed by Commit bot

bpf_dsl: fix argument-dependent lookup of BoolExpr operators

Review URL: https://codereview.chromium.org/543333002

Cr-Commit-Position: refs/heads/master@{#294127}
parent 5f74261a
......@@ -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 {
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment