[jiterp] Fix rare case where an AOT method's arg_offsets were uninitialized while...
authorKatelyn Gadd <kg@luminance.org>
Thu, 25 May 2023 08:44:05 +0000 (01:44 -0700)
committerGitHub <noreply@github.com>
Thu, 25 May 2023 08:44:05 +0000 (01:44 -0700)
src/mono/mono/mini/interp/interp.c
src/mono/wasm/runtime/jiterpreter-jit-call.ts

index 980b488..d85d306 100644 (file)
@@ -2651,7 +2651,8 @@ do_jit_call (ThreadContext *context, stackval *ret_sp, stackval *sp, InterpFrame
                        if (count == mono_opt_jiterpreter_jit_call_trampoline_hit_count) {
                                mono_interp_jit_wasm_jit_call_trampoline (
                                        rmethod->method, rmethod, cinfo,
-                                       rmethod->arg_offsets, mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP
+                                       initialize_arg_offsets(rmethod, mono_method_signature_internal (rmethod->method)),
+                                       mono_aot_mode == MONO_AOT_MODE_LLVMONLY_INTERP
                                );
                        } else {
                                int excess = count - mono_opt_jiterpreter_jit_call_queue_flush_threshold;
index b5a487e..e3e2f56 100644 (file)
@@ -98,6 +98,8 @@ class TrampolineInfo {
         method: MonoMethod, rmethod: VoidPtr, cinfo: VoidPtr,
         arg_offsets: VoidPtr, catch_exceptions: boolean
     ) {
+        mono_assert(arg_offsets, "Expected nonzero arg_offsets pointer");
+
         this.method = method;
         this.rmethod = rmethod;
         this.catchExceptions = catch_exceptions;