@@ -7269,6 +7269,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
72697269 ignore_case = decode_byte (p , & p , end );
72707270
72717271 if (!mono_reflection_parse_type_checked (name , & info , error )) {
7272+ buffer_add_string (buf , mono_error_get_message (error ));
72727273 mono_error_cleanup (error );
72737274 g_free (name );
72747275 mono_reflection_free_type_info (& info );
@@ -7757,6 +7758,8 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
77577758 case CMD_ASSEMBLY_GET_TYPE : {
77587759 ERROR_DECL (error );
77597760 char * s = decode_string (p , & p , end );
7761+ char * original_s = g_strdup_printf ("\"%s\"" , s );
7762+
77607763 gboolean ignorecase = decode_byte (p , & p , end );
77617764 MonoTypeNameParse info ;
77627765 MonoType * t ;
@@ -7772,20 +7775,33 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
77727775 mono_error_cleanup (error );
77737776 t = NULL ;
77747777 } else {
7775- if (info .assembly .name )
7776- NOT_IMPLEMENTED ;
7778+ if (info .assembly .name ) {
7779+ mono_reflection_free_type_info (& info );
7780+ g_free (s );
7781+ mono_domain_set_fast (d , TRUE);
7782+ char * error_msg = g_strdup_printf ("Unexpected assembly-qualified type %s was provided" , original_s );
7783+ buffer_add_string (buf , error_msg );
7784+ g_free (error_msg );
7785+ g_free (original_s );
7786+ return ERR_INVALID_ARGUMENT ;
7787+ }
77777788 t = mono_reflection_get_type_checked (alc , ass -> image , ass -> image , & info , ignorecase , TRUE, & type_resolve , error );
77787789 if (!is_ok (error )) {
77797790 mono_error_cleanup (error ); /* FIXME don't swallow the error */
77807791 mono_reflection_free_type_info (& info );
77817792 g_free (s );
7793+ mono_domain_set_fast (d , TRUE);
7794+ char * error_msg = g_strdup_printf ("Invalid type name %s" , original_s );
7795+ buffer_add_string (buf , error_msg );
7796+ g_free (error_msg );
7797+ g_free (original_s );
77827798 return ERR_INVALID_ARGUMENT ;
77837799 }
77847800 }
77857801 buffer_add_typeid (buf , domain , t ? mono_class_from_mono_type_internal (t ) : NULL );
77867802 mono_reflection_free_type_info (& info );
77877803 g_free (s );
7788-
7804+ g_free ( original_s );
77897805 mono_domain_set_fast (d , TRUE);
77907806
77917807 break ;
@@ -7842,6 +7858,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
78427858 error_init (error );
78437859 MonoClass * mono_class = mono_class_get_checked (ass -> image , token , error );
78447860 if (!is_ok (error )) {
7861+ buffer_add_string (buf , mono_error_get_message (error ));
78457862 mono_error_cleanup (error );
78467863 return ERR_INVALID_ARGUMENT ;
78477864 }
@@ -7858,6 +7875,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
78587875 error_init (error );
78597876 MonoMethod * mono_method = mono_get_method_checked (ass -> image , token , NULL , NULL , error );
78607877 if (!is_ok (error )) {
7878+ buffer_add_string (buf , mono_error_get_message (error ));
78617879 mono_error_cleanup (error );
78627880 return ERR_INVALID_ARGUMENT ;
78637881 }
@@ -8710,6 +8728,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g
87108728
87118729 header = mono_method_get_header_checked (method , error );
87128730 if (!header ) {
8731+ buffer_add_string (buf , mono_error_get_message (error ));
87138732 mono_error_cleanup (error ); /* FIXME don't swallow the error */
87148733 return ERR_INVALID_ARGUMENT ;
87158734 }
@@ -9541,7 +9560,7 @@ string_commands (int command, guint8 *p, guint8 *end, Buffer *buf)
95419560 if (!is_ok (error )) {
95429561 if (s )
95439562 g_free (s );
9544-
9563+ buffer_add_string ( buf , mono_error_get_message ( error ));
95459564 return ERR_INVALID_ARGUMENT ;
95469565 }
95479566 buffer_add_string (buf , s );
0 commit comments