Merge pull request #2810 from kumpera/fix_hazard_free
[mono.git] / mono / mini / exceptions-ia64.c
index 9d13bfbf2c59a3f485e4a2d963cda406fb4caf04..adae20f2b5f2fb83a57d67b3b08b30a77f007483 100644 (file)
@@ -236,18 +236,20 @@ static void
 throw_exception (MonoObject *exc, guint64 rethrow)
 {
        unw_context_t unw_ctx;
+       MonoError error;
        MonoContext ctx;
        MonoJitInfo *ji;
        unw_word_t ip, sp;
        int res;
 
-       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);
 
        res = unw_getcontext (&unw_ctx);
        g_assert (res == 0);