pub fn inject_limiter(
	mut module: elements::Module,
	stack_limit: u32,
) -> Result<elements::Module, Error> {
	let mut ctx = Context {
		stack_height_global_idx: None,
		func_stack_costs: None,
		stack_limit,
	};

	generate_stack_height_global(&mut ctx, &mut module);
	compute_stack_costs(&mut ctx, &module)?;
	instrument_functions(&mut ctx, &mut module)?;
	let module = thunk::generate_thunks(&mut ctx, module)?;

	Ok(module)
}
/// Instrument a module with stack height limiter.
///
/// See module-level documentation for more details.
///
/// # Errors
///
/// Returns `Err` if module is invalid and can't be
Instrument a module with stack height limiter.
See module-level documentation for more details.
Instrument a module with stack height limiter . See module - level documentation for more details .
pub fn inject_limiter(
	mut module: elements::Module,
	stack_limit: u32,
) -> Result<elements::Module, Error> {
	let mut ctx = Context {
		stack_height_global_idx: None,
		func_stack_costs: None,
		stack_limit,
	};
	generate_stack_height_global(&mut ctx, &mut module);
	compute_stack_costs(&mut ctx, &module)?;
	instrument_functions(&mut ctx, &mut module)?;
	let module = thunk::generate_thunks(&mut ctx, module)?;
	Ok(module)
}
pub fn inject_limiter ( mut module : elements :: Module , stack_limit : u32 , ) -> Result < elements :: Module , Error > { let mut ctx = Context { stack_height_global_idx : None , func_stack_costs : None , stack_limit , } ; generate_stack_height_global ( & mut ctx , & mut module ) ; compute_stack_costs ( & mut ctx , & module ) ? ; instrument_functions ( & mut ctx , & mut module ) ? ; let module = thunk :: generate_thunks ( & mut ctx , module ) ? ; Ok ( module ) }
Instrument a module with stack height limiter.
Instrument a module with stack height limiter .
module
elements::Module
stack_limit
u32
module
elements::Module
stack_limit
u32
errors
Returns `Err` if module is invalid and can't be
Returns ` Err ` if module is invalid and can ' t be