pub trait Config<'b> {
    type StackVisitor<'s>: VisitOperatorWithOffset<'b, Output = Result<(), Error>>
       where Self: 's;

    // Required methods
    fn make_visitor<'s>(
        &'s self,
        module_state: &'s ModuleState,
        function_state: &'s mut FunctionState
    ) -> Self::StackVisitor<'s>;
    fn save_outcomes(
        &self,
        state: &mut FunctionState,
        out: &mut AnalysisOutcome
    );
    fn add_function(&self, state: &mut ModuleState, type_index: u32);
    fn add_global(&self, state: &mut ModuleState, content_type: ValType);
    fn add_table(&self, state: &mut ModuleState, content_type: ValType);
    fn add_type(&self, state: &mut ModuleState, ty: Type);
    fn populate_locals(
        &self,
        module: &ModuleState,
        fn_state: &mut FunctionState,
        fn_idx: u32
    ) -> Result<(), Error>;
}
Expand description

The configuration for the stack analysis.

Note that this trait is not intended to be implemented directly. Implement SizeConfig instead. Implementers of SizeConfig trait will also implement max_stack::Config by definition.

Required Associated Types§

source

type StackVisitor<'s>: VisitOperatorWithOffset<'b, Output = Result<(), Error>> where Self: 's

Required Methods§

source

fn make_visitor<'s>( &'s self, module_state: &'s ModuleState, function_state: &'s mut FunctionState ) -> Self::StackVisitor<'s>

source

fn save_outcomes(&self, state: &mut FunctionState, out: &mut AnalysisOutcome)

source

fn add_function(&self, state: &mut ModuleState, type_index: u32)

source

fn add_global(&self, state: &mut ModuleState, content_type: ValType)

source

fn add_table(&self, state: &mut ModuleState, content_type: ValType)

source

fn add_type(&self, state: &mut ModuleState, ty: Type)

source

fn populate_locals( &self, module: &ModuleState, fn_state: &mut FunctionState, fn_idx: u32 ) -> Result<(), Error>

Implementors§

source§

impl<'b> Config<'b> for NoConfig

§

type StackVisitor<'s> = NoOpVisitor<Result<(), Error>>

source§

impl<'b, S: SizeConfig> Config<'b> for S

§

type StackVisitor<'s> where Self: 's = Visitor<'s, S>