http://bugzilla.novell.com/show_bug.cgi?id=502554
Summary: Crash (null-reference) in
Mono.Cecil.MethodReturnType.set_MarshalSpec() when
cloning extern method with MarshalAs()
Classification: Mono
Product: Mono: Class Libraries
Version: unspecified
Platform: x86
OS/Version: Windows Vista
Status: NEW
Severity: Major
Priority: P5 - None
Component: Cecil
AssignedTo: [email protected]
ReportedBy: [email protected]
QAContact: [email protected]
Found By: Other
The following code reproduces this problem:
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Mono.Cecil;
namespace CecilBug
{
class CecilBug
{
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool CloseHandle(IntPtr hObject);
}
class Program
{
static void Main(string[] args)
{
AssemblyDefinition ad =
AssemblyFactory.GetAssembly(Application.ExecutablePath);
foreach (TypeDefinition td in ad.MainModule.Types)
{
Console.WriteLine(td.FullName);
var td2 = td.Clone();
}
Console.ReadLine();
}
}
}
The call to td.Clone() will attempt a clone on the extern method, which in turn
generates the exception.
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs