Fix warnings.
[mono.git] / mono / mini / exceptions-mips.c
index b09243491d3b69a3a0f9944bee014db0f4e74144..710125dcfd14d48f2ff00f39f0c73b251c323833 100644 (file)
@@ -413,33 +413,28 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                                                         mgreg_t **save_locations,
                                                         StackFrameInfo *frame)
 {
-       gpointer ip = MONO_CONTEXT_GET_IP (ctx);
-       gpointer fp = MONO_CONTEXT_GET_BP (ctx);
-       guint32 sp;
-
        memset (frame, 0, sizeof (StackFrameInfo));
        frame->ji = ji;
 
        *new_ctx = *ctx;
 
        if (ji != NULL) {
-               int i;
                gint32 address;
-               int offset = 0;
+               gpointer ip = MONO_CONTEXT_GET_IP (ctx);
+               gpointer fp = MONO_CONTEXT_GET_BP (ctx);
+               guint32 sp;
 
                frame->type = FRAME_TYPE_MANAGED;
 
-               if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
+               if (*lmf && (fp >= (gpointer)(*lmf)->ebp)) {
                        /* remove any unused lmf */
                        *lmf = (*lmf)->previous_lmf;
                }
 
                address = (char *)ip - (char *)ji->code_start;
 
-               /* My stack frame */
-               fp = MONO_CONTEXT_GET_BP (ctx);
-
-               /* Compute the previous stack frame */
+               /* Compute the previous stack frame, assuming method
+                * starts with addiu sp, sp, <offset>. */
                sp = (guint32)(fp) - (short)(*(guint32 *)(ji->code_start));
 
                /* Sanity check the frame */
@@ -489,7 +484,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                MONO_CONTEXT_SET_IP (new_ctx, new_ctx->sc_regs[mips_ra] - 8);
 
                /* Sanity check -- we should have made progress here */
-               g_assert (new_ctx->sc_pc != ctx->sc_pc);
+               g_assert (MONO_CONTEXT_GET_BP (new_ctx) != MONO_CONTEXT_GET_BP (ctx));
                return TRUE;
        } else if (*lmf) {
                if (!(*lmf)->method) {