[llvmonly] Transform the error returned by init_method () into an exception and throw...
authorZoltan Varga <vargaz@gmail.com>
Tue, 10 May 2016 05:43:21 +0000 (01:43 -0400)
committerZoltan Varga <vargaz@gmail.com>
Tue, 10 May 2016 05:58:14 +0000 (01:58 -0400)
mono/mini/aot-runtime.c

index 5cf86261d209f157fec8532671096931307e719f..ef9a9c035c90e1ce1de80e3e06898e274711d46f 100644 (file)
@@ -4265,9 +4265,10 @@ mono_aot_init_llvm_method (gpointer aot_module, guint32 method_index)
        gboolean res;
        MonoError error;
 
-       // FIXME: Handle errors
        res = init_method (amodule, method_index, NULL, NULL, NULL, &error);
-       g_assert (res);
+       // FIXME: Pass the exception up to the caller ?
+       /* Its okay to raise in llvmonly mode */
+       mono_error_raise_exception (&error);
 }
 
 void
@@ -4293,7 +4294,7 @@ mono_aot_init_gshared_method_this (gpointer aot_module, guint32 method_index, Mo
        g_assert (context);
 
        res = init_method (amodule, method_index, NULL, klass, context, &error);
-       g_assert (res);
+       mono_error_raise_exception (&error);
 }
 
 void
@@ -4312,7 +4313,7 @@ mono_aot_init_gshared_method_mrgctx (gpointer aot_module, guint32 method_index,
        context.method_inst = rgctx->method_inst;
 
        res = init_method (amodule, method_index, NULL, rgctx->class_vtable->klass, &context, &error);
-       g_assert (res);
+       mono_error_raise_exception (&error);
 }
 
 void
@@ -4336,7 +4337,7 @@ mono_aot_init_gshared_method_vtable (gpointer aot_module, guint32 method_index,
        g_assert (context);
 
        res = init_method (amodule, method_index, NULL, klass, context, &error);
-       g_assert (res);
+       mono_error_raise_exception (&error);
 }
 
 /*