pub struct SandboxConfig {
pub bounds_check: bool,
pub deadline_check: bool,
pub capability_check: bool,
pub div_check: bool,
}Expand description
Compile-time sandbox configuration. Mirrors the cranelift backend’s
SandboxConfig field-for-field so a side-by-side comparison of the
two AOT backends shares the same knob surface.
Production LLVM buffer entries emit the guard surface unconditionally:
arena bounds checks, div/mod guards, checked signed Int arithmetic,
capability gates, dynamic host-call trap lifting, and deterministic
step-budget fuel. This struct stays field-compatible with cranelift’s
configuration so tests and host code can describe the same policy
intent across backends. The booleans are bench/debug intent records
for LLVM today; they should not be used to create a trusted execution
posture for untrusted source.
Fields§
§bounds_check: boolWhen true, host-visible memory access should be guarded
against the arena byte length. LLVM buffer entries currently emit
these guards unconditionally.
deadline_check: boolWhen true, resource exhaustion should be enforced. LLVM uses
deterministic step-budget fuel configured on LlvmAotEvaluator
rather than reading this bool directly as a wall-clock deadline
switch.
capability_check: boolWhen true, Op::CheckCap bakes the caps-bitmask test into
the emitted object. The codegen/call.rs lowering already emits
it unconditionally for a non-NO_CAPABILITY_BIT bit; this flag
is the host-facing intent record.
div_check: boolWhen true, Op::Div / Op::Mod emit an explicit divisor-zero
guard before LLVM’s sdiv / srem (whose div-by-zero is UB).
The codegen/arith.rs lowering already emits it; this flag is
the host-facing intent record.
Implementations§
Source§impl SandboxConfig
impl SandboxConfig
Trait Implementations§
Source§impl Clone for SandboxConfig
impl Clone for SandboxConfig
Source§fn clone(&self) -> SandboxConfig
fn clone(&self) -> SandboxConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SandboxConfig
impl Debug for SandboxConfig
Source§impl Default for SandboxConfig
impl Default for SandboxConfig
impl Eq for SandboxConfig
Source§impl PartialEq for SandboxConfig
impl PartialEq for SandboxConfig
Source§fn eq(&self, other: &SandboxConfig) -> bool
fn eq(&self, other: &SandboxConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SandboxConfig
Auto Trait Implementations§
impl Freeze for SandboxConfig
impl RefUnwindSafe for SandboxConfig
impl Send for SandboxConfig
impl Sync for SandboxConfig
impl Unpin for SandboxConfig
impl UnsafeUnpin for SandboxConfig
impl UnwindSafe for SandboxConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more