diff options
author | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2018-04-13 02:19:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-13 02:19:00 +0300 |
commit | 753b12932bf934605d40901d5e10c67e1e1a34fd (patch) | |
tree | e00e99f1228545d2ce942d3d91c59cbe68d7a4b6 /src/ILCompiler.MetadataTransform | |
parent | 657a36664050c9c5f0053a341d5f99b5d6588dd6 (diff) |
Fix metadata generation for null string constants (#5690)
This should take the code path that returns `ConstantReferenceValue`.
Diffstat (limited to 'src/ILCompiler.MetadataTransform')
-rw-r--r-- | src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs b/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs index ecf9532e7..31f61c5e8 100644 --- a/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs +++ b/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.CustomAttribute.cs @@ -117,14 +117,14 @@ namespace ILCompiler.Metadata return new ConstantUInt64Value { Value = (ulong)value }; } - if (type.IsString) + if (value == null) { - return HandleString((string)value); + return new ConstantReferenceValue(); } - if (value == null) + if (type.IsString) { - return new ConstantReferenceValue(); + return HandleString((string)value); } if (type.IsSzArray) |