mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #877 from hvitved/csharp/matches-handle
C#: Use `matchesHandle()` instead of `getLabel()`
This commit is contained in:
@@ -28,13 +28,13 @@ class Declaration extends DotNet::Declaration, Element, @cil_declaration {
|
||||
final predicate isSourceDeclaration() { this = getSourceDeclaration() }
|
||||
}
|
||||
|
||||
private CS::Declaration toCSharpNonTypeParameter(Declaration d) { result.getLabel() = d.getLabel() }
|
||||
private CS::Declaration toCSharpNonTypeParameter(Declaration d) { result.matchesHandle(d) }
|
||||
|
||||
private CS::TypeParameter toCSharpTypeParameter(TypeParameter tp) {
|
||||
toCSharpTypeParameterJoin(tp, result.getIndex(), result.getGeneric())
|
||||
}
|
||||
|
||||
pragma[noinline, nomagic]
|
||||
pragma[nomagic]
|
||||
private predicate toCSharpTypeParameterJoin(TypeParameter tp, int i, CS::UnboundGeneric ug) {
|
||||
exists(TypeContainer tc |
|
||||
tp.getIndex() = i and
|
||||
|
||||
@@ -93,7 +93,7 @@ class NamedElement extends Element, @dotnet_named_element {
|
||||
predicate compiledFromSource() {
|
||||
not this.fromSource() and
|
||||
exists(NamedElement other | other != this |
|
||||
other.getLabel() = this.getLabel() and
|
||||
this.matchesHandle(other) and
|
||||
other.fromSource()
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user