Skip to content

Commit eda345a

Browse files
committed
C#: Address review comments.
1 parent e3380aa commit eda345a

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

csharp/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ private module Input implements InputSig<CsharpDataFlow> {
3030
n instanceof FlowInsensitiveFieldNode
3131
}
3232

33-
predicate missingLocationExclude(Node n) { none() }
34-
3533
predicate postWithInFlowExclude(Node n) {
3634
n instanceof FlowSummaryNode
3735
or

csharp/ql/lib/semmle/code/csharp/dispatch/RuntimeCallable.qll

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ class RuntimeCallable extends Callable {
2121
}
2222

2323
/** A run-time method. */
24-
class RuntimeMethod extends RuntimeCallable {
25-
RuntimeMethod() { this instanceof Method }
26-
27-
/** Holds if the method is `static`. */
28-
predicate isStatic() { this.(Method).isStatic() }
29-
}
24+
class RuntimeMethod extends RuntimeCallable, Method { }
3025

3126
/** A run-time instance method. */
3227
class RuntimeInstanceMethod extends RuntimeMethod {

csharp/ql/test/library-tests/cil/consistency/Handles.expected

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ tooManyMatchingHandles
33
missingCil
44
csharpLocationViolation
55
matchingObjectMethods
6-
| System.Boolean System.Object.Equals(System.Object) | System.Boolean System.Object.Equals(System.Object) |
7-
| System.Boolean System.Object.Equals(System.Object,System.Object) | System.Boolean System.Object.Equals(System.Object,System.Object) |
8-
| System.Boolean System.Object.ReferenceEquals(System.Object,System.Object) | System.Boolean System.Object.ReferenceEquals(System.Object,System.Object) |
9-
| System.Int32 System.Object.GetHashCode() | System.Int32 System.Object.GetHashCode() |
10-
| System.Object System.Object.MemberwiseClone() | System.Object System.Object.MemberwiseClone() |
11-
| System.String System.Object.ToString() | System.String System.Object.ToString() |
12-
| System.Type System.Object.GetType() | System.Type System.Object.GetType() |
13-
| System.Void System.Object..ctor() | System.Void System.Object..ctor() |
14-
| System.Void System.Object.Finalize() | System.Void System.Object.Finalize() |
6+
| Equals(object) | System.Boolean System.Object.Equals(System.Object) |
7+
| Equals(object, object) | System.Boolean System.Object.Equals(System.Object,System.Object) |
8+
| GetHashCode() | System.Int32 System.Object.GetHashCode() |
9+
| GetType() | System.Type System.Object.GetType() |
10+
| MemberwiseClone() | System.Object System.Object.MemberwiseClone() |
11+
| Object() | System.Void System.Object..ctor() |
12+
| ReferenceEquals(object, object) | System.Boolean System.Object.ReferenceEquals(System.Object,System.Object) |
13+
| ToString() | System.String System.Object.ToString() |
14+
| ~Object() | System.Void System.Object.Finalize() |

csharp/ql/test/library-tests/cil/consistency/Handles.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ deprecated query predicate csharpLocationViolation(Element e) {
5959
}
6060

6161
deprecated query predicate matchingObjectMethods(string s1, string s2) {
62-
exists(DotNet::Callable m1, CIL::Method m2 |
62+
exists(Callable m1, CIL::Method m2 |
6363
m1.getDeclaringType().hasFullyQualifiedName("System", "Object") and
64-
m1.matchesHandle(m2) and
64+
m1.(DotNet::Callable).matchesHandle(m2) and
6565
s1 = m1.toStringWithTypes() and
6666
s2 = m2.toStringWithTypes()
6767
)

0 commit comments

Comments
 (0)