Skip to content

Commit e092b31

Browse files
committed
C#: Add test exposing missing phi flow
1 parent c08230c commit e092b31

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

csharp/ql/test/library-tests/dataflow/delegates/DelegateFlow.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,13 @@ public unsafe void M18()
124124
delegate*<Action<int>, void> fnptr = &M2;
125125
fnptr((i) => { });
126126
}
127+
128+
void M19(Action a, bool b)
129+
{
130+
if (b)
131+
a = () => {};
132+
a();
133+
}
134+
135+
void M20(bool b) => M19(() => {}, b);
127136
}

csharp/ql/test/library-tests/dataflow/delegates/DelegateFlow.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ delegateCall
2424
| DelegateFlow.cs:89:35:89:37 | delegate call | DelegateFlow.cs:65:10:65:12 | M11 | DelegateFlow.cs:91:13:91:47 | delegate creation of type MyDelegate |
2525
| DelegateFlow.cs:89:35:89:37 | delegate call | DelegateFlow.cs:74:17:74:19 | M12 | DelegateFlow.cs:92:13:92:15 | delegate creation of type MyDelegate |
2626
| DelegateFlow.cs:89:35:89:37 | delegate call | DelegateFlow.cs:93:13:93:21 | (...) => ... | DelegateFlow.cs:93:13:93:21 | (...) => ... |
27+
| DelegateFlow.cs:132:9:132:11 | delegate call | DelegateFlow.cs:131:17:131:24 | (...) => ... | file://:0:0:0:0 | <empty> |

0 commit comments

Comments
 (0)