[interp]Fix the type of clause_args. (#31651)
authormonojenkins <jo.shields+jenkins@xamarin.com>
Tue, 4 Feb 2020 06:26:50 +0000 (01:26 -0500)
committerGitHub <noreply@github.com>
Tue, 4 Feb 2020 06:26:50 +0000 (07:26 +0100)
Co-authored-by: Jay Krell <jay.krell@cornell.edu>
src/mono/mono/mini/interp/interp-internals.h
src/mono/mono/mini/interp/interp.c

index e062e2c4fda10ec77766ded64feca99db0220881..9149591791f90f14f880b93d7c2201636f75e366 100644 (file)
@@ -189,13 +189,17 @@ typedef struct {
        int inited;
 } FrameStack;
 
+
+/* Arguments that are passed when invoking only a finally/filter clause from the frame */
+typedef struct FrameClauseArgs FrameClauseArgs;
+
 /* State of the interpreter main loop */
 typedef struct {
        stackval *sp;
        unsigned char *vt_sp;
        const unsigned short  *ip;
        GSList *finally_ips;
-       gpointer clause_args;
+       FrameClauseArgs *clause_args;
 } InterpState;
 
 struct _InterpFrame {
index a2ec894aa40b9bd2397b4b0be3e8e7003f3941bd..17b6fde8df9651dcafec801b0c0814df1a8d6cb4 100644 (file)
@@ -84,7 +84,7 @@
 #endif
 
 /* Arguments that are passed when invoking only a finally/filter clause from the frame */
-typedef struct {
+struct FrameClauseArgs {
        /* Where we start the frame execution from */
        const guint16 *start_with_ip;
        /*
@@ -98,7 +98,7 @@ typedef struct {
        /* Exception that we are filtering */
        MonoException *filter_exception;
        InterpFrame *base_frame;
-} FrameClauseArgs;
+};
 
 /*
  * This code synchronizes with interp_mark_stack () using compiler memory barriers.
@@ -3465,14 +3465,14 @@ method_entry (ThreadContext *context, InterpFrame *frame, gboolean *out_tracing,
        sp = frame->state.sp; \
        vt_sp = frame->state.vt_sp; \
        finally_ips = frame->state.finally_ips; \
-       clause_args = (FrameClauseArgs*)frame->state.clause_args;                       \
+       clause_args = frame->state.clause_args;                 \
        locals = (unsigned char *)frame->stack + frame->imethod->stack_size + frame->imethod->vt_stack_size; \
        frame->state.ip = NULL; \
        } while (0)
 
 /* Initialize interpreter state for executing FRAME */
 #define INIT_INTERP_STATE(frame, _clause_args) do {     \
-       ip = _clause_args ? ((FrameClauseArgs*)_clause_args)->start_with_ip : (frame)->imethod->code; \
+       ip = _clause_args ? (_clause_args)->start_with_ip : (frame)->imethod->code; \
        sp = (frame)->stack; \
        vt_sp = (unsigned char *) sp + (frame)->imethod->stack_size; \
        locals = (unsigned char *) vt_sp + (frame)->imethod->vt_stack_size; \
@@ -3798,8 +3798,8 @@ main_loop:
                        }
 
                        frame = child_frame;
-                       INIT_INTERP_STATE (frame, NULL);
                        clause_args = NULL;
+                       INIT_INTERP_STATE (frame, clause_args);
 
                        MINT_IN_BREAK;
                }
@@ -3903,8 +3903,8 @@ retry_callvirt_fast:
                                }
 
                                frame = child_frame;
-                               INIT_INTERP_STATE (frame, NULL);
                                clause_args = NULL;
+                               INIT_INTERP_STATE (frame, clause_args);
                        } else if (imethod->code_type == IMETHOD_CODE_COMPILED) {
                                error_init_reuse (error);
                                do_jit_call (sp, vt_sp, context, frame, imethod, error);
@@ -4022,8 +4022,8 @@ retry_callvirt_fast:
                        }
 
                        frame = child_frame;
-                       INIT_INTERP_STATE (frame, NULL);
                        clause_args = NULL;
+                       INIT_INTERP_STATE (frame, clause_args);
 
                        MINT_IN_BREAK;
                }