}
static gboolean
-decode_method_ref (MonoAotModule *module, MethodRef *ref, guint8 *buf, guint8 **endbuf)
+decode_method_ref (MonoAotModule *module, MethodRef *ref, guint8 *buf, guint8 **endbuf, MonoError *error)
{
- MonoError error;
- gboolean res = decode_method_ref_with_target (module, ref, NULL, buf, endbuf, &error);
- if (!is_ok (&error)) {
- g_warning ("Could not decode methodref due to %s", mono_error_get_message (&error));
- mono_error_cleanup (&error);
- }
- return res;
+ return decode_method_ref_with_target (module, ref, NULL, buf, endbuf, error);
}
/*
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module '%s' not found: %s\n", aot_name, err);
g_free (err);
- aot_name = g_strdup_printf ("%s/mono/aot-cache/%s/%s%s", mono_assembly_getrootdir(), MONO_ARCHITECTURE, g_path_get_basename (assembly->image->name), MONO_SOLIB_EXT);
+ g_free (aot_name);
+ char *basename = g_path_get_basename (assembly->image->name);
+ aot_name = g_strdup_printf ("%s/mono/aot-cache/%s/%s%s", mono_assembly_getrootdir(), MONO_ARCHITECTURE, basename, MONO_SOLIB_EXT);
+ g_free (basename);
sofile = mono_dl_open (aot_name, MONO_DL_LAZY, &err);
if (!sofile) {
mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module '%s' not found: %s\n", aot_name, err);
static gboolean
decode_cached_class_info (MonoAotModule *module, MonoCachedClassInfo *info, guint8 *buf, guint8 **endbuf)
{
+ MonoError error;
guint32 flags;
MethodRef ref;
gboolean res;
info->is_generic_container = (flags >> 8) & 0x1;
if (info->has_cctor) {
- res = decode_method_ref (module, &ref, buf, &buf);
+ res = decode_method_ref (module, &ref, buf, &buf, &error);
+ mono_error_assert_ok (&error); /* FIXME don't swallow the error */
if (!res)
return FALSE;
info->cctor_token = ref.token;
}
if (info->has_finalize) {
- res = decode_method_ref (module, &ref, buf, &buf);
+ res = decode_method_ref (module, &ref, buf, &buf, &error);
+ mono_error_assert_ok (&error); /* FIXME don't swallow the error */
if (!res)
return FALSE;
info->finalize_image = ref.image;
gpointer
mono_aot_get_method_from_vt_slot (MonoDomain *domain, MonoVTable *vtable, int slot)
{
+ MonoError error;
int i;
MonoClass *klass = vtable->klass;
MonoAotModule *amodule = (MonoAotModule *)klass->image->aot_module;
if (!err)
return NULL;
- for (i = 0; i < slot; ++i)
- decode_method_ref (amodule, &ref, p, &p);
+ for (i = 0; i < slot; ++i) {
+ decode_method_ref (amodule, &ref, p, &p, &error);
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
+ }
- res = decode_method_ref (amodule, &ref, p, &p);
+ res = decode_method_ref (amodule, &ref, p, &p, &error);
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
if (!res)
return NULL;
if (ref.no_aot_trampoline)
mono_error_cleanup (&error); /* FIXME don't swallow the error */
}
- gi->generic_sharing_context = g_new0 (MonoGenericSharingContext, 1);
+ gi->generic_sharing_context = alloc0_jit_info_data (domain, sizeof (MonoGenericSharingContext), async);
if (decode_value (p, &p)) {
/* gsharedvt */
MonoGenericSharingContext *gsctx = gi->generic_sharing_context;
MethodRef ref;
gboolean res;
- res = decode_method_ref (aot_module, &ref, p, &p);
+ res = decode_method_ref (aot_module, &ref, p, &p, &error);
+ mono_error_assert_ok (&error); /* FIXME don't swallow the error */
if (!res)
goto cleanup;