[Mono-devel-list] pointer overwritten in mini.c

Sébastien Pouliot spouliot at videotron.ca
Tue Nov 2 14:32:55 EST 2004


Hello,

I was tracking who was allocating MonoJitInfo and found...

	if (cfg->method->dynamic)
		jinfo = g_new0 (MonoJitInfo, 1);
	else
		jinfo = mono_mempool_alloc0 (cfg->domain->mp, sizeof (MonoJitInfo));

	jinfo = g_new0 (MonoJitInfo, 1);

in mini.c / mini_method_compile.

The last line overwritea the first jinfo pointer (unless I'm missing
something).
The first part of the code (if) was changed in mini.c 1.290.
http://cvs.hispalinux.es/cgi-bin/cvsweb/mono/mono/mini/mini.c?rev=1.289&cont
ent-type=text/x-cvsweb-markup&cvsroot=mono

Before that the code was:

        jinfo = mono_mempool_alloc0 (cfg->domain->mp, sizeof (MonoJitInfo));
        jinfo = g_new0 (MonoJitInfo, 1);

since mini.c 1.1.
http://cvs.hispalinux.es/cgi-bin/cvsweb/~checkout~/mono/mono/mini/mini.c?rev
=1.1&content-type=text/plain&cvsroot=mono

Any reasons for that ?

If not can I apply the attached patch ?

The patch doesn't affect
* corlib unit tests;
* tests in /mono/tests/ stops at (with or without the patch)

mcs --unsafe -nowarn:0162 -r:TestDriver.dll -out:iface6.exe iface6.cs
iface6.cs(53) error CS0121: Ambiguous call when selecting function due to
implicit casts
iface6.cs(5): 'IA.Add(int)' (name of symbol related to previous error)
iface6.cs(10): 'IB.Add(int)' (name of symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
make: *** [iface6.exe] Error 1

Sebastien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mini.diff
Type: application/octet-stream
Size: 558 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20041102/94d1523f/attachment.obj 


More information about the Mono-devel-list mailing list