Skip to content

Commit efe2fb5

Browse files
committed
C#: Convert libraries to use matchesHandle instead of getLabel.
1 parent 2acde22 commit efe2fb5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

csharp/ql/src/semmle/code/csharp/commons/Disposal.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private predicate disposedCSharpVariable(Variable variable) {
3838
// A C# parameter is disposed if its corresponding CIL parameter is disposed
3939
exists(CIL::Method m, CIL::Parameter p, int i |
4040
disposedCilVariable(p) and p = m.getRawParameter(i) |
41-
variable = any(Callable c2 | c2.getLabel() = m.getLabel()).getRawParameter(i)
41+
variable = any(Callable c2 | c2.matchesHandle(m)).getRawParameter(i)
4242
)
4343
or
4444
// Call to a method that disposes it

csharp/ql/src/semmle/code/csharp/dataflow/DataFlow.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,14 +627,14 @@ module DataFlow {
627627
result = sourceDecl
628628
else if sourceDecl instanceof CIL::Callable then
629629
// CIL callable with C# implementation in the database
630-
sourceDecl.getLabel() = result.(Callable).getLabel()
630+
sourceDecl.matchesHandle(result.(Callable))
631631
or
632632
// CIL callable without C# implementation in the database
633-
not sourceDecl.getLabel() = any(Callable k).getLabel() and
633+
not sourceDecl.matchesHandle(any(Callable k)) and
634634
result = sourceDecl
635635
else
636636
// C# callable without C# implementation in the database
637-
sourceDecl.getLabel() = result.(CIL::Callable).getLabel()
637+
sourceDecl.matchesHandle(result.(CIL::Callable))
638638
)
639639
}
640640

0 commit comments

Comments
 (0)