Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2010-04-01 03:09:53 +0400
committerZoltan Varga <vargaz@gmail.com>2010-04-01 03:09:53 +0400
commit1e41bd36872fe79bf5be4a9226ba8a8157a8484c (patch)
tree837d143b4a4a1e84e81cf6f44e944d6175323f08 /mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
parente47e2d0ae0b39df3e6c07427f90c54cf497d5345 (diff)
2010-04-01 Zoltan Varga <vargaz@gmail.com>
* TypeBuilder.cs (GetField): Avoid a crash if this is called on a FieldOnTypeBuilderInst. Fixes #586944. svn path=/trunk/mcs/; revision=154580
Diffstat (limited to 'mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs')
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs3
1 files changed, 3 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
index 2b74fbeeca1..a4b7185428d 100644
--- a/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs
@@ -1864,6 +1864,9 @@ namespace System.Reflection.Emit
if (type.IsGenericTypeDefinition)
throw new ArgumentException ("Type cannot be a generic type definition", "type");
+ if (field is FieldOnTypeBuilderInst)
+ throw new ArgumentException ("The specified field must be declared on a generic type definition.", "field");
+
FieldInfo res = type.GetField (field);
if (res == null)
throw new System.Exception ("field not found");