Skip to content

Commit db047c2

Browse files
committed
C#: Extract CIL fields using their underlying types for a reference type field and annotate the field as a reference type.
1 parent 812bc20 commit db047c2

File tree

1 file changed

+6
-4
lines changed
  • csharp/extractor/Semmle.Extraction.CIL/Entities

1 file changed

+6
-4
lines changed

csharp/extractor/Semmle.Extraction.CIL/Entities/Field.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using Microsoft.CodeAnalysis;
4-
using System.IO;
1+
using System.Collections.Generic;
52

63
namespace Semmle.Extraction.CIL.Entities
74
{
@@ -38,6 +35,11 @@ public override IEnumerable<IExtractionProduct> Contents
3835
t = mt.Unmodified;
3936
yield return Tuples.cil_custom_modifiers(this, mt.Modifier, mt.IsRequired);
4037
}
38+
if (t is ByRefType brt)
39+
{
40+
t = brt.ElementType;
41+
yield return Tuples.cil_type_annotation(this, TypeAnnotation.Ref);
42+
}
4143
yield return Tuples.cil_field(this, DeclaringType, Name, t);
4244
}
4345
}

0 commit comments

Comments
 (0)