pub fn stack_satisfies_function_signature(
    state: &AbstractState,
    function_index: FunctionHandleIndex,
) -> bool {
    let state_copy = state.clone();
    let function_handle = state_copy.module.function_handle_at(function_index);
    let function_signature = state_copy
        .module
        .function_signature_at(function_handle.signature);
    let mut satisfied = true;
    for (i, arg_type) in function_signature.arg_types.iter().rev().enumerate() {
        let abstract_value = AbstractValue {
            token: arg_type.clone(),
            kind: SignatureTokenView::new(&state.module, arg_type).kind(&[]),
        };
        if !stack_has(&state, i, Some(abstract_value)) {
            satisfied = false;
        }
    }
    satisfied
}
/// Determine whether the function at the given index can be constructed from the values on
/// the stack.
Determine whether the function at the given index can be constructed from the values on
the stack.
Determine whether the function at the given index can be constructed from the values on the stack .
pub fn stack_satisfies_function_signature(
    state: &AbstractState,
    function_index: FunctionHandleIndex,
) -> bool {
    let state_copy = state.clone();
    let function_handle = state_copy.module.function_handle_at(function_index);
    let function_signature = state_copy
        .module
        .function_signature_at(function_handle.signature);
    let mut satisfied = true;
    for (i, arg_type) in function_signature.arg_types.iter().rev().enumerate() {
        let abstract_value = AbstractValue {
            token: arg_type.clone(),
            kind: SignatureTokenView::new(&state.module, arg_type).kind(&[]),
        };
        if !stack_has(&state, i, Some(abstract_value)) {
            satisfied = false;
        }
    }
    satisfied
}
pub fn stack_satisfies_function_signature ( state : & AbstractState , function_index : FunctionHandleIndex , ) -> bool { let state_copy = state . clone ( ) ; let function_handle = state_copy . module . function_handle_at ( function_index ) ; let function_signature = state_copy . module . function_signature_at ( function_handle . signature ) ; let mut satisfied = true ; for ( i , arg_type ) in function_signature . arg_types . iter ( ) . rev ( ) . enumerate ( ) { let abstract_value = AbstractValue { token : arg_type . clone ( ) , kind : SignatureTokenView :: new ( & state . module , arg_type ) . kind ( & [ ] ) , } ; if ! stack_has ( & state , i , Some ( abstract_value ) ) { satisfied = false ; } } satisfied }
Determine whether the function at the given index can be constructed from the values on
the stack.
Determine whether the function at the given index can be constructed from the values on the stack .
state
&AbstractState
function_index
FunctionHandleIndex