Skip to content

Commit 090e896

Browse files
committed
C#: Change Property TagStackBehaviour to push a tag, to give the expression body a tag stack.
1 parent bb49fe1 commit 090e896

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Entities/Property.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ class PropertyFactory : ICachedEntityFactory<IPropertySymbol, Property>
114114
public Property Create(Context cx, IPropertySymbol init) => new Property(cx, init);
115115
}
116116

117-
public override TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.NoLabel;
117+
public override TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.PushesLabel;
118118
}
119119
}

csharp/ql/test/library-tests/regressions/Program.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ void F()
131131
class LocalVariableTags
132132
{
133133
Func<int, int> F = x => { int y=x; return y; };
134+
135+
private static Func<object, string, object> _getter => (o, n) =>
136+
{
137+
object x = o;
138+
return x;
139+
};
134140
}
135141

136142
// semmle-extractor-options: /r:System.Dynamic.Runtime.dll

csharp/ql/test/library-tests/regressions/TypeMentions.expected

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@
5959
| Program.cs:133:10:133:12 | Int32 |
6060
| Program.cs:133:15:133:17 | Int32 |
6161
| Program.cs:133:31:133:33 | Int32 |
62+
| Program.cs:135:20:135:23 | Func<Object,String,Object> |
63+
| Program.cs:135:25:135:30 | Object |
64+
| Program.cs:135:33:135:38 | String |
65+
| Program.cs:135:41:135:46 | Object |
66+
| Program.cs:137:10:137:15 | Object |

0 commit comments

Comments
 (0)