Skip to content

Commit

Permalink
Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
Browse files Browse the repository at this point in the history
	* reflection.c: output also literal strings. Allocate parameter data
	with GC_malloc() (thanks, Martin, for catching this!).

svn path=/trunk/mono/; revision=3357
  • Loading branch information
illupus committed Mar 26, 2002
1 parent 222833b commit c58206b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions mono/metadata/ChangeLog
@@ -1,3 +1,9 @@

Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>

* reflection.c: output also literal strings. Allocate parameter data
with GC_malloc() (thanks, Martin, for catching this!).

2002-03-26 Martin Baulig <martin@gnome.org>

* debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
Expand Down
17 changes: 16 additions & 1 deletion mono/metadata/reflection.c
Expand Up @@ -788,7 +788,18 @@ encode_constant (MonoDynamicAssembly *assembly, MonoObject *val, guint32 *ret_ty
goto handle_enum;
} else
g_error ("we can't encode valuetypes");
case MONO_TYPE_STRING:
case MONO_TYPE_STRING: {
MonoString *str = (MonoString*)val;
/* there is no signature */
len = str->length * 2;
mono_metadata_encode_value (len, b, &b);
idx = mono_image_add_stream_data (&assembly->blob, blob_size, b-blob_size);
/* FIXME: ENOENDIAN */
mono_image_add_stream_data (&assembly->blob, mono_string_chars (str), len);

g_free (buf);
return idx;
}
default:
g_error ("we don't encode constant type 0x%02x yet", *ret_type);
}
Expand Down Expand Up @@ -2106,7 +2117,11 @@ mono_param_get_objects (MonoDomain *domain, MonoMethod *method)
*/
CHECK_OBJECT (MonoReflectionParameter**, &(method->signature));
oklass = mono_class_from_name (mono_defaults.corlib, "System.Reflection", "ParameterInfo");
#if HAVE_BOEHM_GC
res = GC_malloc (sizeof (MonoReflectionParameter*) * method->signature->param_count);
#else
res = g_new0 (MonoReflectionParameter*, method->signature->param_count);
#endif
for (i = 0; i < method->signature->param_count; ++i) {
res [i] = (MonoReflectionParameter *)mono_object_new (domain, oklass);
res [i]->ClassImpl = mono_type_get_object (domain, method->signature->params [i]);
Expand Down

0 comments on commit c58206b

Please sign in to comment.