diff options
author | Jay Krell <jay.krell@cornell.edu> | 2020-02-04 08:25:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-04 08:25:57 +0300 |
commit | 8c0f6db26f32e1c6589e9eadad5185e20e5f2ebb (patch) | |
tree | 20fb403c4a4b8e7c0b1a165a8ab69ad981039dcd | |
parent | f3d2cc21769050a96bc1fabb6760942dff535699 (diff) |
[interp]Fix the type of clause_args. (#18671)
[interp]Fix the type of clause_args.
-rw-r--r-- | mono/mini/interp/interp-internals.h | 6 | ||||
-rw-r--r-- | mono/mini/interp/interp.c | 14 |
2 files changed, 12 insertions, 8 deletions
diff --git a/mono/mini/interp/interp-internals.h b/mono/mini/interp/interp-internals.h index e062e2c4fda..9149591791f 100644 --- a/mono/mini/interp/interp-internals.h +++ b/mono/mini/interp/interp-internals.h @@ -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 { diff --git a/mono/mini/interp/interp.c b/mono/mini/interp/interp.c index a2ec894aa40..17b6fde8df9 100644 --- a/mono/mini/interp/interp.c +++ b/mono/mini/interp/interp.c @@ -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; } |