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
path: root/mcs
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2010-03-30 07:31:36 +0400
committerZoltan Varga <vargaz@gmail.com>2010-03-30 07:31:36 +0400
commit425bd35013cecefd6b723fc03821baabb131ffdd (patch)
tree532236cc1983e4b71f71d30ecd5ac9a8d566094a /mcs
parentca42a7b3f1aabec04bf9c786c030ff9cf5c046d5 (diff)
2010-03-30 Zoltan Varga <vargaz@gmail.com>
* CustomAttributeBuilder.cs (IsValidType): Call Enum.GetUnderlyingType () for dynamic enums to avoid crashes in the unmanaged code. Fixes #591800. svn path=/branches/mono-2-6/mcs/; revision=154420
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/ChangeLog5
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs5
2 files changed, 10 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.Reflection.Emit/ChangeLog b/mcs/class/corlib/System.Reflection.Emit/ChangeLog
index ed0296701c3..5c8d063401c 100644
--- a/mcs/class/corlib/System.Reflection.Emit/ChangeLog
+++ b/mcs/class/corlib/System.Reflection.Emit/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-30 Zoltan Varga <vargaz@gmail.com>
+
+ * CustomAttributeBuilder.cs (IsValidType): Call Enum.GetUnderlyingType () for
+ dynamic enums to avoid crashes in the unmanaged code. Fixes #591800.
+
2010-02-09 Sebastien Pouliot <sebastien@ximian.com>
* ModuleBuilder.cs: Do not use reflection to create SymbolWriterImpl
diff --git a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs b/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
index 420c1397252..6bb407dcd7a 100644
--- a/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/CustomAttributeBuilder.cs
@@ -93,6 +93,11 @@ namespace System.Reflection.Emit {
/* FIXME: Add more checks */
if (t.IsArray && t.GetArrayRank () > 1)
return false;
+ if (t is TypeBuilder && t.IsEnum) {
+ // Check that the enum is properly constructed, the unmanaged code
+ // depends on this
+ Enum.GetUnderlyingType (t);
+ }
return true;
}