diff --git a/src/Function.cs b/src/Function.cs index 3025616..333a220 100644 --- a/src/Function.cs +++ b/src/Function.cs @@ -416,7 +416,7 @@ private unsafe IntPtr Invoke(Span argumentsAndResults, StoreContext st IntPtr trap; fixed (ValueRaw* argsAndResultsPtr = argumentsAndResults) { - error = Native.wasmtime_func_call_unchecked(storeContext.handle, func, argsAndResultsPtr, out trap); + error = Native.wasmtime_func_call_unchecked(storeContext.handle, func, argsAndResultsPtr, (nuint)argumentsAndResults.Length, out trap); // See comments above for the two reasons why the `Store` must be kept alive here. GC.KeepAlive(store); @@ -718,7 +718,7 @@ internal static class Native public static unsafe extern IntPtr wasmtime_func_call(IntPtr context, in ExternFunc func, Value* args, nuint nargs, Value* results, nuint nresults, out IntPtr trap); [DllImport(Engine.LibraryName)] - public static unsafe extern IntPtr wasmtime_func_call_unchecked(IntPtr context, in ExternFunc func, ValueRaw* args_and_results, out IntPtr trap); + public static unsafe extern IntPtr wasmtime_func_call_unchecked(IntPtr context, in ExternFunc func, ValueRaw* args_and_results, nuint args_and_results_len, out IntPtr trap); [DllImport(Engine.LibraryName)] public static extern IntPtr wasmtime_func_type(IntPtr context, in ExternFunc func);