Skip to main content

## build_libffi_closure

# Function build_libffi_closure

Source

    pub fn build_libffi_closure<'tcx, 'this>(
        this: &'this MiriInterpCx<'tcx>,
        fn_sig: FnSig<'tcx>,
    ) -> InterpResult<'tcx, unsafe extern "C" fn()>

Expand description

This function sets up a new libffi closure to intercept calls to rust code via function pointers passed to native code.

Calling this function leaks the data passed into the libffi closure as these need to be available until the execution terminates as the native code side could store a function pointer and only call it at a later point.