From da66e6b1190715307e4833fc6af9a4cc80bffbe4 Mon Sep 17 00:00:00 2001 From: kumpera Date: Tue, 22 Dec 2009 01:14:16 +0000 Subject: [PATCH] 2009-12-21 Rodrigo Kumpera * get.c (get_type): Don't crash if the type is not found. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mono@148827 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- mono/dis/ChangeLog | 4 ++++ mono/dis/get.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mono/dis/ChangeLog b/mono/dis/ChangeLog index c7affa203..0470bd6ff 100644 --- a/mono/dis/ChangeLog +++ b/mono/dis/ChangeLog @@ -1,3 +1,7 @@ +2009-12-21 Rodrigo Kumpera + + * get.c (get_type): Don't crash if the type is not found. + 2009-08-18 Christian Hergert * dis-cil.c: diff --git a/mono/dis/get.c b/mono/dis/get.c index 6c4d1582c..d167c84ac 100644 --- a/mono/dis/get.c +++ b/mono/dis/get.c @@ -1276,7 +1276,11 @@ get_type (MonoImage *m, const char *ptr, char **result, gboolean is_def, MonoGen case MONO_TYPE_CLASS: { guint32 token = mono_metadata_parse_typedef_or_ref (m, ptr, &ptr); MonoClass *klass = mono_class_get (m, token); - char *temp = dis_stringify_object_with_class (m, klass, TRUE, FALSE); + char *temp; + if (klass) + temp = dis_stringify_object_with_class (m, klass, TRUE, FALSE); + else + temp = g_strdup_printf ("", token); if (show_tokens) { *result = g_strdup_printf ("%s/*%08x*/", temp, token); -- 2.11.4.GIT