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

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Strehovsky <michals@microsoft.com>2017-04-18 04:02:27 +0300
committerMichal Strehovsky <michals@microsoft.com>2017-04-18 04:02:27 +0300
commiteadcda4da7b80695541b47b5304ed075b5e681e3 (patch)
treea4e158982307c4a10ceec5a9860c622711ec3782 /src/ILCompiler.MetadataTransform
parentfb678ca4ae954e2375575e834d225f6c4de54642 (diff)
Update custom attribute metadata schema to support enum arrays as element of object arrays
Four things: * The actual schema update * Update the CoreRT metadata emitter to emit the new schema * Update the Project N metadata emitter to emit the new schema * Update reflection codebase to read the new schema Fixes dotnet/corert#3328. [tfs-changeset: 1654618]
Diffstat (limited to 'src/ILCompiler.MetadataTransform')
-rw-r--r--src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs b/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs
index 9e74138dc..ecf9532e7 100644
--- a/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs
+++ b/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs
@@ -147,7 +147,17 @@ namespace ILCompiler.Metadata
{
Cts.TypeDesc elementType = type.ElementType;
- switch (elementType.UnderlyingType.Category)
+ if (elementType.IsEnum)
+ {
+ Cts.TypeSystemContext context = type.Context;
+ return new ConstantEnumArray
+ {
+ ElementType = HandleType(elementType),
+ Value = HandleCustomAttributeConstantArray(context.GetArrayType(elementType.UnderlyingType), value),
+ };
+ }
+
+ switch (elementType.Category)
{
case Cts.TypeFlags.Boolean:
return new ConstantBooleanArray { Value = GetCustomAttributeConstantArrayElements<bool>(value) };