[Mono-bugs] [Bug 353849] New: MakeGenericMethod crashes with SIGSEGV instead of ArgumentException
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Jan 15 05:03:32 EST 2008
https://bugzilla.novell.com/show_bug.cgi?id=353849
Summary: MakeGenericMethod crashes with SIGSEGV instead of
ArgumentException
Product: Mono: Runtime
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: generics
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: msafar at novell.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Compile & Run following sample.
using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;
namespace ConsoleApplication1
{
class Program
{
static void Main (string [] args)
{
ModuleBuilder module;
AssemblyName assemblyName = new AssemblyName ();
assemblyName.Name =
"MonoTests.System.Reflection.Emit.MethodBuilderTest";
AssemblyBuilder assembly = Thread.GetDomain
().DefineDynamicAssembly (
assemblyName, AssemblyBuilderAccess.Run);
module = assembly.DefineDynamicModule ("module1");
TypeBuilder tb = module.DefineType ("Class",
TypeAttributes.Public);
MethodBuilder mb = tb.DefineMethod ("box_int",
MethodAttributes.Public |
MethodAttributes.Static, typeof (object), new Type [] { typeof (int) });
GenericTypeParameterBuilder [] pars =
mb.DefineGenericParameters (new string [] { "foo" });
ILGenerator ilgen = mb.GetILGenerator ();
ilgen.Emit (OpCodes.Ldarg_0);
ilgen.Emit (OpCodes.Box, pars [0]);
ilgen.Emit (OpCodes.Ret);
Type t = tb.CreateType ();
MethodInfo mi = t.GetMethod ("box_int");
try {
mi.MakeGenericMethod (new Type[] { null });
throw new ApplicationException ();
} catch (ArgumentException e) {
Console.WriteLine ("Error: " + e.Message);
}
}
}
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list