[sdb] Fix an aot assert.
[mono.git] / mono / mini / exceptions-ppc.c
index e872d1336924448ed4bc993352b9744b18551c01..80a579b05eb87e539e3b1c344edf636991b4c667 100644 (file)
@@ -318,6 +318,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 void
 mono_ppc_throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, mgreg_t *int_regs, gdouble *fp_regs, gboolean rethrow)
 {
+       MonoError error;
        MonoContext ctx;
 
        /* adjust eip so that it point into the call instruction */
@@ -331,13 +332,14 @@ mono_ppc_throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp,
        memcpy (&ctx.regs, int_regs, sizeof (mgreg_t) * MONO_SAVED_GREGS);
        memcpy (&ctx.fregs, fp_regs, sizeof (double) * MONO_SAVED_FREGS);
 
-       if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+       if (mono_object_isinst_checked (exc, mono_defaults.exception_class, &error)) {
                MonoException *mono_ex = (MonoException*)exc;
                if (!rethrow) {
                        mono_ex->stack_trace = NULL;
                        mono_ex->trace_ips = NULL;
                }
        }
+       mono_error_assert_ok (&error);
        mono_handle_exception (&ctx, exc);
        mono_restore_context (&ctx);
 
@@ -786,3 +788,16 @@ mono_arch_handle_exception (void *ctx, gpointer obj)
        return result;
 #endif
 }
+
+
+// FIX ME: This is not complete
+void
+mono_arch_setup_async_callback (MonoContext *ctx, void (*async_cb)(void *fun), gpointer user_data)
+{
+       uintptr_t sp = (uintptr_t) MONO_CONTEXT_GET_SP(ctx);
+       sp -= PPC_MINIMAL_STACK_SIZE;
+       *(unsigned long *)sp = MONO_CONTEXT_GET_SP(ctx);
+       MONO_CONTEXT_SET_BP(ctx, sp);
+       MONO_CONTEXT_SET_IP(ctx, (unsigned long) async_cb);
+}
+